#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int f[1001000];
int s[1001000];
long long hash1[1001000], hash2[1001000];
int conv(char f) {
  if (f == 'W') return 1;
  if (f == 'E') return 2;
  if (f == 'S') return 3;
  if (f == 'N') return 4;
}
int main() {
  int n;
  cin >> n;
  n--;
  string a;
  cin >> a;
  string b;
  cin >> b;
  for (long long i = 0; i < (int)n; i++) {
    if (b[i] == 'W')
      b[i] = 'E';
    else if (b[i] == 'N')
      b[i] = 'S';
    else if (b[i] == 'S')
      b[i] = 'N';
    else if (b[i] == 'E')
      b[i] = 'W';
  }
  for (long long i = 0; i < (int)n / 2; i++) swap(b[i], b[n - i - 1]);
  hash1[n] = 0;
  for (int i = n - 1; i >= 0; i--)
    hash1[i] = (hash1[i + 1] * 104239 + conv(a[i])) % 1000000007;
  hash2[0] = conv(b[0]);
  long long pwr = 1;
  for (int i = 1; i < n; i++) {
    pwr = (pwr * 104239) % 1000000007;
    hash2[i] = (hash2[i - 1] + conv(b[i]) * pwr) % 1000000007;
  }
  bool ans = 0;
  for (long long i = 0; i < (int)n; i++) {
    if (ans) break;
    if (hash2[i] == hash1[n - i - 1]) {
      bool chk = 0;
      for (int j = 0; j <= i; j++)
        if (b[j] != a[n - i - 1 + j]) chk = 1;
      if (!chk) ans = 1;
    }
  }
  if (ans)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
