#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e6 + 10;
const int MOD = 1e6 + 37;
int n;
char path1[MAX_N], path2[MAX_N];
int map1[200], map2[200];
int deg4[MAX_N];
void init() {
  map1['N'] = 'N' - 'A';
  map1['E'] = 'E' - 'A';
  map1['S'] = 'S' - 'A';
  map1['W'] = 'W' - 'A';
  map2['N'] = 'S' - 'A';
  map2['E'] = 'W' - 'A';
  map2['S'] = 'N' - 'A';
  map2['W'] = 'E' - 'A';
  deg4[0] = 1;
  for (int(i) = (1); (i) < (n); ++(i)) {
    deg4[i] = 27 * deg4[i - 1];
    if (deg4[i] > MOD) deg4[i] %= MOD;
  }
}
void input() {
  scanf("%d", &n);
  --n;
  scanf("%s%s", path1, path2);
}
bool eq(int beg) {
  for (int(i) = (beg); (i) < (n); ++(i)) {
    if (map1[path1[i]] != map2[path2[n - i + beg - 1]]) return false;
  }
  return true;
}
bool solve() {
  int hash1 = 0, hash2 = 0;
  for (int i = n - 1; i >= 0; --i) {
    hash1 += deg4[n - i - 1] * map1[path1[i]];
    if (hash1 > MOD) hash1 %= MOD;
    hash2 *= 27;
    hash2 += map2[path2[i]];
    if (hash2 > MOD) hash2 %= MOD;
    if (hash1 == hash2 && eq(i)) return false;
  }
  return true;
}
int main() {
  input();
  init();
  solve() ? printf("YES\n") : printf("NO\n");
  return 0;
}
