#K74207. Transforming Strings with Fixed Alphabet Shift
Transforming Strings with Fixed Alphabet Shift
Transforming Strings with Fixed Alphabet Shift
Given two strings \(s\) and \(t\) of equal length, determine whether \(s\) can be transformed into \(t\) by applying a fixed shift to every character. In other words, for a fixed integer shift \(d\) (with \(0 \le d < 26\)), every character \(s_i\) in \(s\) must be replaced by the character \(t_i\) such that:
\[ t_i \equiv s_i + d \pmod{26} \]
If such a constant shift exists across all character positions, output YES, otherwise output NO.
inputFormat
The input is read from standard input (stdin) and consists of multiple test cases. Each test case is given on a separate line containing two space-separated strings \(s\) and \(t\). The input terminates with a line that contains only the character '#' which should not be processed.
outputFormat
For each test case, output a line to standard output (stdout) containing YES if \(s\) can be transformed into \(t\) using a fixed shift; otherwise output NO.
## sampleabc cde
xyz abc
aaaa bbbb
abcd efgh
mmm nnn
abc cdc
#
YES
YES
YES
YES
YES
NO
</p>