#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MOD = INF + 7;
const int MAXN = 2000010;
int f[MAXN];
int main() {
  map<char, char> mp = {{'N', 'S'}, {'S', 'N'}, {'E', 'W'}, {'W', 'E'}};
  int n;
  while (cin >> n) {
    n--;
    string a, b;
    cin >> a >> b;
    reverse(a.begin(), a.end());
    for (char &ch : a) {
      ch = mp[ch];
    }
    string s = "*" + a + b;
    int m = 2 * n;
    f[1] = 0;
    for (int i = 2; i <= m; i++) {
      int j = f[i - 1];
      while (j && s[i] != s[j + 1]) {
        j = f[j];
      }
      if (s[i] == s[j + 1]) {
        j++;
      }
      f[i] = j;
    }
    int idx = m;
    while (idx > n) {
      idx = f[idx];
    }
    cout << (idx ? "NO" : "YES") << endl;
  }
  return 0;
}
