#include <bits/stdc++.h>
using namespace std;
int ff[2000005];
int main() {
  int n;
  string s, t;
  cin >> n >> s >> t;
  n--;
  reverse(s.begin(), s.end());
  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] == 'S')
      s[i] = 'N';
    else
      s[i] = 'S';
  }
  for (int i = 0; i < n; i++) s += t[i];
  ff[0] = -1;
  int k = -1;
  for (int i = 1; i < n + n; i++) {
    while (k > -1 && s[k + 1] != s[i]) k = ff[k];
    if (s[k + 1] == s[i]) k++;
    ff[i] = k;
  }
  int indx = ff[n + n - 1];
  if (indx > -1)
    puts("NO");
  else
    puts("YES");
  return 0;
}
