#include <bits/stdc++.h>
using namespace std;
void pf(string s) {
  long n = s.size();
  vector<int> pi(n, 0);
  for (int i = 1; i < n; ++i) {
    int j = pi[i - 1];
    while (j > 0 && s[i] != s[j]) j = pi[j - 1];
    if (s[i] == s[j]) ++j;
    pi[i] = j;
  }
  if (pi[n - 1] == 0)
    cout << "YES";
  else
    cout << "NO";
}
int main() {
  long n;
  string s, s1;
  cin >> n;
  cin >> s >> s1;
  for (long i = 0; i < s1.size(); i++) {
    if (s1[i] == 'N')
      s1[i] = 'S';
    else if (s1[i] == 'W')
      s1[i] = 'E';
    else if (s1[i] == 'S')
      s1[i] = 'N';
    else if (s1[i] == 'E')
      s1[i] = 'W';
  }
  long j = n - 2;
  for (long i = 0; i <= j; i++, j--) swap(s1[i], s1[j]);
  s = s1 + '$' + s;
  pf(s);
  return 0;
}
