#include <bits/stdc++.h>
const int MAX_N = (int)1e6 + 123;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;
using namespace std;
string a, b;
int p[2 * MAX_N];
int main() {
  ios_base ::sync_with_stdio(NULL), cin.tie(NULL);
  int n;
  cin >> n;
  cin >> a >> b;
  for (int i = 0; i < int((a).size()); i++) {
    if (a[i] == 'S')
      a[i] = 'N';
    else if (a[i] == 'N')
      a[i] = 'S';
    else if (a[i] == 'W')
      a[i] = 'E';
    else
      a[i] = 'W';
  }
  reverse(a.begin(), a.end());
  a = a + '#' + b;
  for (int i = 1; i < int((a).size()); i++) {
    int j = p[i - 1];
    while (j > 0 && a[i] != a[j]) j = p[j - 1];
    if (a[i] == a[j]) j++;
    p[i] = j;
  }
  if (p[int((a).size()) - 1] > 0)
    puts("NO");
  else
    puts("YES");
  return 0;
}
