#include <bits/stdc++.h>
using namespace std;
string a, b, tmp;
int len;
int nxt[2016000];
void make_nxt() {
  nxt[0] = 0;
  for (int q = 1, k = 0; q < 2 * len + 1; q++) {
    while (k > 0 && tmp[q] != tmp[k]) k = nxt[k - 1];
    if (tmp[q] == tmp[k]) k++;
    nxt[q] = k;
  }
}
int main() {
  cin >> len >> a >> b;
  len--;
  reverse(a.begin(), a.end());
  for (int i = 0; i < len; i++) {
    if (a[i] == 'W')
      a[i] = 'E';
    else if (a[i] == 'E')
      a[i] = 'W';
    else if (a[i] == 'S')
      a[i] = 'N';
    else if (a[i] == 'N')
      a[i] = 'S';
  }
  tmp = a + '#' + b;
  make_nxt();
  if (nxt[2 * len] != 0)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
