#include <bits/stdc++.h>
using namespace std;
const int Nmax = 1000000 + 10;
const char v[4] = {'N', 'E', 'S', 'W'};
int to[100];
int n;
int phi[Nmax];
string a, b;
void makePhi() {
  int k;
  phi[0] = 0;
  for (int i = 2; i <= n; ++i) {
    k = phi[i - 1];
    while (k && a[k + 1] != a[i]) k = phi[k];
    if (a[k + 1] == a[i])
      phi[i] = k + 1;
    else
      phi[i] = 0;
  }
}
bool makeKmp() {
  int k = 0;
  for (int i = 1; i <= n; ++i) {
    while (k && a[k + 1] != b[i]) k = phi[k];
    if (a[k + 1] == b[i]) k++;
  }
  return (k == 0);
}
int main() {
  cin >> n;
  n--;
  cin >> a;
  reverse(a.begin(), a.end());
  a = ' ' + a;
  cin >> b;
  b = ' ' + b;
  to['N'] = 0;
  to['E'] = 1;
  to['S'] = 2;
  to['W'] = 3;
  for (int i = 1; i <= n; ++i) a[i] = v[(to[a[i]] + 2) % 4];
  makePhi();
  if (makeKmp())
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
