#include <bits/stdc++.h>
const int p = 1000000097;
long long t1[1200000], t2[1200000], t3[12000000];
char c1[1200000], c2[1200000];
int i, n;
int main() {
  scanf("%d", &n);
  n--;
  getchar();
  gets(c1 + 1);
  gets(c2 + 1);
  for (i = 1; i <= n; i++) switch (c2[i]) {
      case 'N':
        c2[i] = 'S';
        break;
      case 'W':
        c2[i] = 'E';
        break;
      case 'S':
        c2[i] = 'N';
        break;
      case 'E':
        c2[i] = 'W';
        break;
    }
  for (i = 1; i <= n; i++) t1[i] = (t1[i - 1] * 26 + c1[i] - 64) % p;
  for (i = 1; i <= n; i++) t2[i] = (t2[i - 1] * 26 + c2[n - i + 1] - 64) % p;
  t3[0] = 1;
  for (i = 1; i <= n; i++) t3[i] = t3[i - 1] * 26 % p;
  for (i = 1; i <= n; i++)
    if ((t1[n] - t1[n - i] * t3[i] % p + p) % p == t2[i]) {
      puts("NO");
      return 0;
    }
  puts("YES");
  return 0;
}
