#include <bits/stdc++.h>
using namespace std;
const long long N = 2e6;
const long long M = 20;
const long long SQ = 320;
const long long INF = 1e16;
const long long MOD = 1e9 + 7;
string s1, s2, s;
int f[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n1;
  cin >> n1;
  n1--;
  cin >> s1 >> s2;
  reverse(s1.begin(), s1.end());
  for (int i = 0; i < n1; 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';
  }
  s = s1 + "/" + s2;
  int n = 2 * n1 + 1;
  f[1] = 0;
  for (int i = 1; i < n; i++) {
    int state = f[i];
    while (state && s[state] != s[i]) state = f[state];
    if (s[state] == s[i]) state++;
    f[i + 1] = state;
  }
  if (f[n])
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
