#include <bits/stdc++.h>
using namespace std;
int pi[2022022];
int n;
bool KMP(string x) {
  int q = 0;
  for (int i = 2; i < x.length(); i++) {
    while (q > 0 && x[q + 1] != x[i]) q = pi[q];
    if (x[q + 1] == x[i]) q++;
    pi[i] = q;
  }
  if (pi[2 * n - 1] > 0) return 1;
  return 0;
}
string s1, s2;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  cin >> s1;
  cin >> s2;
  reverse(s1.begin(), s1.end());
  for (int i = 0; i < s1.length(); i++) {
    if (s1[i] == 'N')
      s1[i] = 'S';
    else if (s1[i] == 'S')
      s1[i] = 'N';
    else if (s1[i] == 'E')
      s1[i] = 'W';
    else if (s1[i] == 'W')
      s1[i] = 'E';
  }
  s1 += '#';
  s1 += s2;
  s1 = '0' + s1;
  if (KMP(s1))
    cout << "NO\n";
  else
    cout << "YES\n";
}
