Communication with the organizers
Upon receiving information from the jury about potential obstacles in signal transmission using a laser, the crew of the Tau Ceti ship must account for these obstacles when interpreting the received messages. In the Tau Ceti language, there are no concepts of "beginning of a word" or "end of a word," meaning any two words that can be transformed into each other through a series of cyclic shifts are considered equivalent. A cyclic shift involves moving the first character of a word to its end.
Due to cloud interference, as calculated by the onboard communicator, exactly one letter in each word may be received incorrectly. Therefore, to address the error correction problem, the ship's crew needs to determine whether the received word, after replacing exactly one character with another, can be equivalent to a dictionary word of the same length.
Write a program to perform this check.
Input
The first line of the input file contains the length 1 ≤ n ≤ 1000000 of the received word. The second line contains the received word, consisting of n lowercase Latin letters. The third line contains the dictionary word, also consisting of n lowercase Latin letters.
Output
Output the word NO if the received word is already equivalent to the dictionary word in the Tau Ceti language or cannot be made equivalent by replacing exactly one letter. Otherwise, output YES on the first line, followed by an ordered list of all ordinal numbers of cyclic shifts of the received word, where the string differs from the dictionary word in exactly one position (define the ordinal number of a cyclic shift consisting of n single cyclic shifts as n. The ordinal number of the "empty" shift is 0).