#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0);
const int MAXN = 3000001;
int a[MAXN];
int z[MAXN];
int n;
string s;
void go() {
  a[2 * n + 1] = -1;
  int m = 2 * n, l = 0, r = 0;
  for (int i = 1; i <= m; i++) {
    int k = min(r - i, z[i - l]);
    if (k < 0) k = 0;
    while (a[k] == a[i + k]) k++;
    z[i] = k;
    if (i + k > r) l = i, r = i + k;
  }
  for (int i = 1; i <= n; i++) {
    if (z[2 * n - i + 1] >= i) {
      cout << "NO" << endl;
      exit(0);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  n--;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'N')
      a[i] = 0;
    else if (s[i] == 'S')
      a[i] = 3;
    else if (s[i] == 'W')
      a[i] = 1;
    else
      a[i] = 2;
  }
  a[n] = -2;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[n - 1 - i] == 'N')
      a[i + n + 1] = 3;
    else if (s[n - 1 - i] == 'S')
      a[i + n + 1] = 0;
    else if (s[n - 1 - i] == 'W')
      a[i + n + 1] = 2;
    else
      a[i + n + 1] = 1;
  }
  reverse(a, a + n);
  reverse(a + n + 1, a + 2 * n + 1);
  go();
  cout << "YES" << endl;
  return 0;
}
