#include <bits/stdc++.h>
using namespace std;
inline void EnableFileIO(const string& fileName, bool local = 0) {
  if (fileName.empty()) return;
  if (local) {
    freopen((fileName + ".in").c_str(), "r", stdin);
    freopen((fileName + ".out").c_str(), "w", stdout);
    return;
  }
  freopen((fileName + ".in").c_str(), "r", stdin);
  freopen((fileName + ".out").c_str(), "w", stdout);
}
const int INF = (1 << 30) - 1;
const long long LINF = (1LL << 61) - 1;
const double EPS = 1e-10, PI = acos(-1);
const int N = 1e6 + 100, P = 1e9 + 7;
int n;
char a[N], b[N];
int va[N], vb[N], ra[N], rb[N];
unsigned long long ha[N], hb[N], pw[N];
int vals[N];
int main() {
  vals['N'] = 1926;
  vals['S'] = -1926;
  vals['W'] = 817;
  vals['E'] = -817;
  scanf("%d", &n);
  scanf("%s", a);
  for (int i = 0; i < n - 1; i++) {
    va[i] = vals[a[i]];
  }
  scanf("%s", b);
  for (int i = 0; i < n - 1; i++) {
    vb[i] = -vals[b[i]];
  }
  unsigned long long ha = 0, hb = 0, pv = 1;
  for (int i = n - 2; i >= 0; i--) {
    ha = ha * P + va[i];
    hb = hb + vb[i] * pv;
    pv *= P;
    if (ha == hb) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  return 0;
}
