#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int maxn = 1000000 + 5;
const int MAGIC = 233;
const long double eps = 1e-6;
long double PI = acos((long double)(-1));
int n;
int base[maxn];
char a[maxn], b[maxn];
unsigned int ha[maxn], hb[maxn];
inline void init_hash(int l, char *s, unsigned int *h) {
  h[0] = 0;
  for (int i = 1; i <= l; i++) h[i] = h[i - 1] * MAGIC + s[i - 1];
  base[0] = 1;
  for (int i = 1; i <= l; i++) base[i] = base[i - 1] * MAGIC;
}
inline unsigned int string_hash(unsigned int *h, int l, int r) {
  return h[r] - h[l] * base[r - l];
}
int main() {
  scanf("%d", &n);
  scanf("%s%s", a, b);
  int sz = n - 1;
  reverse(a, a + sz);
  for (int i = 0; i < sz; i++)
    if (a[i] == 'W')
      a[i] = 'E';
    else if (a[i] == 'E')
      a[i] = 'W';
    else if (a[i] == 'N')
      a[i] = 'S';
    else if (a[i] == 'S')
      a[i] = 'N';
  init_hash(sz, a, ha);
  init_hash(sz, b, hb);
  for (int i = 0; i < sz; i++)
    if (string_hash(ha, 0, sz - i) == string_hash(hb, i, sz)) {
      puts("NO");
      return 0;
    }
  puts("YES");
  return 0;
}
