#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
char c[100];
char a[maxn], b[maxn];
unsigned long long ha, hb, B = 37, p = 1;
int n, i, j;
int main() {
  scanf("%d", &n);
  scanf("%s%s", a + 1, b + 1);
  n--;
  c['S'] = 'N';
  c['N'] = 'S';
  c['W'] = 'E';
  c['E'] = 'W';
  for (i = 1; i <= n; i++) a[i] = c[a[i]];
  for (i = 1; i <= n; i++) {
    ha = ha * B + a[n - i + 1];
    hb = hb + b[n - i + 1] * p;
    p *= B;
    if (ha == hb) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  return 0;
}
