func_code_string: #include <bits/stdc++.h>   char s1[1000100], s2[1000100];   char s[1000100 * 2];   int i, j, n, m;   inline char rev(char& a) {     if (a ==  N ) return  S ;     if (a ==  W ) return  E ;     if (a ==  S ) return  N ;     if (a ==  E ) return  W ;     return 0;   }   int z[1000100 * 2];   inline void Z() {     int L = 0, R = 0;     for (int i = 1; i < n; i++) {       if (i > R) {         L = R = i;         while (R < n && s[R - L] == s[R]) R++;         z[i] = R - L;         R--;       } else {         int k = i - L;         if (z[k] < R - i + 1)           z[i] = z[k];         else {           L = i;           while (R < n && s[R - L] == s[R]) R++;           z[i] = R - L;           R--;         }       }     }   }   int main() {     scanf( %d , &n);     n--;     scanf(  %s %s , s1, s2);     for (i = 0; i < n; i++) {       s2[i] = rev(s2[i]);       s[n - i - 1] = s2[i];       s[i + n] = s1[i];     }     n *= 2;     Z();     n /= 2;     for (i = 0; i < n; i++) {       if (z[i + n] >= n - i) {         printf( NO n );         return 0;       }     }     printf( YES n );     return 0;   }   