#include <bits/stdc++.h>
using namespace std;
int len;
char a[1000005], b[1000005];
unordered_map<char, char> mp = {{'N', 'S'}, {'S', 'N'}, {'E', 'W'}, {'W', 'E'}};
unsigned long long seed = 2333, hashs[3][1000005];
void askHash(char n[1000005], unsigned long long desk[1000005]) {
  for (int i = 1; i <= len; i++) desk[i] = desk[i - 1] * seed + n[i];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> len >> (a + 1) >> (b + 1);
  len--;
  for (int i = 1; i <= len; i++) b[i] = mp[b[i]];
  reverse(b + 1, b + 1 + len);
  hashs[0][0] = 1;
  for (int i = 1; i <= 1000000; i++) hashs[0][i] = hashs[0][i - 1] * seed;
  askHash(a, hashs[1]);
  askHash(b, hashs[2]);
  for (int i = len; i >= 1; i--) {
    if (hashs[1][len] - hashs[1][i - 1] * hashs[0][len - i + 1] ==
        hashs[2][len - i + 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
