#include <bits/stdc++.h>
using namespace std;
long long int seed = 13;
char s[1000005];
char t[1000005];
int main() {
  int n;
  scanf("%d%s%s", &n, s, t);
  --n;
  reverse(t, t + n);
  for (int i = 0; i < n; ++i) {
    if (t[i] == 'E') {
      t[i] = 'W';
    } else if (t[i] == 'W') {
      t[i] = 'E';
    } else if (t[i] == 'N') {
      t[i] = 'S';
    } else {
      t[i] = 'N';
    }
  }
  bool f = false;
  long long int h1 = 0, h2 = 0;
  long long int temp = 1;
  for (int i = 0; i < n && (!f); ++i) {
    h1 = (h1 * seed + t[i]);
    h2 = h2 + s[n - 1 - i] * temp;
    if (h1 == h2) {
      f = true;
    }
    temp *= seed;
  }
  cout << (f ? "NO" : "YES") << endl;
}
