#include <bits/stdc++.h>
using namespace std;
const int inf = 200000;
int n, a[1000005], b[1000005];
map<pair<int, int>, bool> mp;
int id(char ch) {
  if (ch == 'W') return 0;
  if (ch == 'E') return 1;
  if (ch == 'S') return 2;
  if (ch == 'N') return 3;
}
int f[1000005];
void getfill() {
  for (int i = 1; i < n; i++) {
    int j = f[i];
    while (j && a[i] != a[j]) j = f[j];
    f[i + 1] = (a[i] == a[j]) ? j + 1 : 0;
  }
}
int find() {
  int j = 0;
  for (int i = 0; i < n; i++) {
    while (j && b[i] != a[j]) j = f[j];
    if (b[i] == a[j]) j++;
  }
  return j;
}
int main() {
  char ch;
  cin >> n;
  getchar();
  n--;
  for (int i = 0; i < n; i++) {
    scanf("%c", &ch);
    a[i] = id(ch);
  }
  for (int i = 0; i < n / 2; i++) {
    swap(a[i], a[n - i - 1]);
  }
  getchar();
  for (int i = 0; i < n; i++) {
    scanf("%c", &ch);
    b[i] = id(ch) ^ 1;
  }
  getfill();
  if (!find())
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
