MFNNM - Davy Jones’s Organ

Two melodies don’t go out of Davy Jones’s head. One of them or another sometimes emerge in his mind. To get rid of annoying melodies, Davy Jones decided to play them on his organ. At first, he wants consequently perform first and second melodies. And then Davy Jones is going to play the same notes as the first time but in the reverse order.

If the first and second compositions sound exactly the same, then, according to Davy Jones's idea, the melodies will no longer vary by his subconscious and finally will leave him alone.

Jones recorded the notes of both songs. He was sure in the song’s duration, but not really in which place every song begins. But it is not important, because they play cyclically in his mind and you can choose any place as a start in each of them.

Input

In the first line of the input you are given a string of length n — sequence of notes of the first melody. In the second line there is a string of length m — sequence of notes of the second melody (1 ≤ m < n ≤ 5.104, mn). Each note is represented by lowercase Latin letter. Order of notes in the melody corresponds to their order in its playback accurate within start of the melody.

Output

If it is impossible to play compositions conceived by Davy Jones's way, output “No”. Otherwise, in the first line write “Yes” and in the second — a pair of integers — numbers of notes in the first and second tunes respectively, which you should choose as a start. Numbering of notes corresponds to a record of melodies in the input and starts from one. If there are several possible solutions choose the one with the smallest possible tune index from the first note. If there are still many solutions print any.

Example

Input:
cdedab
bac

Output:
Yes
5 3
Input:
aaaa
bbb

Output:
No

Added by:islam
Date:2013-04-05
Time limit:1s-8s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Open Ural FU Championship 2012

hide comments
2013-04-22 08:41:30 Mostafa Fahim
Ok you start playing from 5th position in the first melody, wrapping around till you reach the 4th note, you then play the second melody starting from 3rd position. If you did so the resulting song can be played in reverse order and still sound the same :D
2013-04-22 08:41:30 Ahmad Soliman
Could someone explain the first example? I understood nothing from the statement xD
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.