#include <bits/stdc++.h>
using namespace std;
namespace Stand_IO_Operation {
inline int read() {
  int f = 1, res = 0, ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') res = res * 10 + ch - 48, ch = getchar();
  return f * res;
}
int _sta[1 << 8];
inline void write(int val) {
  if (!val) {
    putchar('0');
    return;
  }
  if (val < 0) putchar('-'), val = -val;
  *_sta = 0;
  while (val > 0) _sta[++*_sta] = val % 10, val /= 10;
  for (int i = *_sta, _Lim = 1; i >= _Lim; i--) putchar(_sta[i] + 48);
}
};  // namespace Stand_IO_Operation
using namespace Stand_IO_Operation;
const int N = 2000005;
int n, len;
int nxt[N];
string a, b;
string all;
char change(char c) {
  if (c == 'N') return 'S';
  if (c == 'S') return 'N';
  if (c == 'W') return 'E';
  return 'W';
}
void kmp() {
  int i, j;
  len = all.length();
  nxt[0] = -1;
  j = -1;
  for (int i = 1; i <= len; i++) {
    while (j != -1 && all[i] != all[j + 1]) j = nxt[j];
    if (all[i] == all[j + 1]) j++;
    nxt[i] = j;
  }
}
int main() {
  n = read();
  n--;
  cin >> a >> b;
  reverse(b.begin(), b.end());
  for (int i = 0; i < n; i++) b[i] = change(b[i]);
  all = b + ' ' + a;
  kmp();
  if (nxt[len - 1] == -1)
    puts("YES");
  else
    puts("NO");
  return 0;
}
