#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
template <typename T>
bool chkmin(T &a, T b) {
  return b < a ? a = b, true : false;
}
template <typename T>
bool chkmax(T &a, T b) {
  return b > a ? a = b, true : false;
}
template <class T>
void read(T &x) {
  char c;
  int flag = 1;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') flag = -1;
  x = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') x = x * 10 + c - '0';
  x *= flag;
}
template <class T>
void write(T x) {
  if (x < 0) putchar('-'), x = -x;
  static char s[20];
  int top = 0;
  while (x) s[++top] = x % 10 + '0', x /= 10;
  if (top == 0) putchar('0');
  while (top) putchar(s[top--]);
}
const int MAXN = 1e6 + 100;
const int Base = 37;
map<char, char> inv;
char a[MAXN], b[MAXN];
int N;
void init();
void solve();
int main() {
  init();
  solve();
}
void init() {
  scanf("%d", &N);
  N--;
  scanf("%s", a + 1);
  scanf("%s", b + 1);
  inv['W'] = 'E', inv['E'] = 'W', inv['N'] = 'S', inv['S'] = 'N';
  for (int i = 1; i <= N; ++i) a[i] = inv[a[i]];
}
void solve() {
  unsigned long long ha = 0, hb = 0, p = 1;
  for (int i = 1; i <= N; ++i) {
    ha = ha * Base + a[N - i + 1];
    hb = hb + b[N - i + 1] * p;
    p *= Base;
    if (ha == hb) {
      puts("NO");
      return;
    }
  }
  puts("YES");
}
