func_code_string: #include <bits/stdc++.h>   using namespace std;   const int inf = (int)1e9;   const double eps = (double)1e-8;   const int mod = (int)1000000007;   const int maxn = (int)1e6 + 5;   int n, l, r, z[2 * maxn];   string a, b, c, d;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n;     cin >> a;     cin >> b;     c =   ;     for (int i = (n - 1); i >= (0); i--) {       if (a[i] ==  W ) c +=  E ;       if (a[i] ==  E ) c +=  W ;       if (a[i] ==  N ) c +=  S ;       if (a[i] ==  S ) c +=  N ;     }     d = c +  #  + b;     l = 0;     r = 0;     z[0] = 0;     for (int i = (1); i < (d.size()); i++) {       z[i] = 0;       if (i <= r) z[i] = min(r - i + 1, z[i - l]);       while (i + z[i] < d.size() && d[i + z[i]] == d[z[i]]) {         z[i]++;       }       if (i + z[i] - 1 > r) {         l = i;         r = i + z[i] - 1;       }       if (i + z[i] - 1 == (int)d.size() - 1) {         cout <<  NO ;         return 0;       }     }     cout <<  YES ;     return 0;   }   