#include <bits/stdc++.h>
using namespace std;
char _;
const int maxN = 1000 * 1000 + 5;
const int mod = 1000 * 1000 * 1000 + 7;
const int base = 313;
const int SQ = 600;
const int maxL = 20;
int f[maxN];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  n--;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'E')
      s[i] = 'W';
    else if (s[i] == 'W')
      s[i] = 'E';
    else if (s[i] == 'N')
      s[i] = 'S';
    else if (s[i] == 'S')
      s[i] = 'N';
  }
  reverse(s.begin(), s.end());
  int k = 0;
  for (int i = 1; i < n; i++) {
    while (k && s[k] != s[i]) k = f[k - 1];
    if (s[k] == s[i]) k++;
    f[i] = k;
  }
  k = 0;
  for (int i = 0; i < n; i++) {
    while (k && t[i] != s[k]) k = f[k - 1];
    if (s[k] == t[i]) k++;
  }
  if (k)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
