func_code_string: #include <bits/stdc++.h>   using namespace std;   const int M = 1000005;   const int P = 1e9 + 9;   int Hash[2][M];   int base[M];   int getHash(int *h, int L, int R) {     return (h[R] - 1LL * h[L - 1] * base[R - L + 1] % P + P) % P;   }   char A[M], B[M], C[M];   int main() {     int n;     cin >> n;     n--;     scanf( %s%s , A + 1, C + 1);     for (int i = 1; i <= n; ++i) B[i] = C[n - i + 1];     for (int i = 1; i <= n; ++i) {       char k = B[i];       if (k ==  N ) B[i] =  S ;       if (k ==  S ) B[i] =  N ;       if (k ==  W ) B[i] =  E ;       if (k ==  E ) B[i] =  W ;     }     base[0] = 1;     for (int i = 1; i <= n; ++i) base[i] = 1LL * base[i - 1] * 233 % P;     for (int i = 1; i <= n; ++i) {       Hash[0][i] = (1LL * Hash[0][i - 1] * 233 % P + A[i]) % P;       Hash[1][i] = (1LL * Hash[1][i - 1] * 233 % P + B[i]) % P;     }     for (int i = 1; i <= n; ++i) {       if (getHash(Hash[0], n - i + 1, n) == getHash(Hash[1], 1, i)) {         puts( NO );         return 0;       }     }     puts( YES );     return 0;   }   