#include <bits/stdc++.h>
using namespace std;
const double g = 10.0, eps = 1e-12;
const int N = 1000000 + 10, maxn = 5000000 + 10, inf = 0x3f3f3f3f,
          INF = 0x3f3f3f3f3f3f3f3f;
char s[N], p[N];
int Next[N], n;
void getnext() {
  Next[0] = -1;
  int k = -1;
  for (int i = 1; i < n - 1; i++) {
    while (k > -1 && p[k + 1] != p[i]) k = Next[k];
    if (p[k + 1] == p[i]) k++;
    Next[i] = k;
  }
}
bool kmp() {
  int k = -1;
  for (int i = 0; i < n - 1; i++) {
    while (k > -1 && p[k + 1] != s[i]) k = Next[k];
    if (p[k + 1] == s[i]) k++;
  }
  return k != -1;
}
int main() {
  scanf("%d%s%s", &n, &s, &p);
  int now = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == 'N')
      s[i] = 'S';
    else if (s[i] == 'S')
      s[i] = 'N';
    else if (s[i] == 'E')
      s[i] = 'W';
    else
      s[i] = 'E';
  }
  reverse(p, p + n - 1);
  getnext();
  puts(!kmp() ? "YES" : "NO");
  return 0;
}
