#include <bits/stdc++.h>
using namespace std;
int n;
string a, b, s;
vector<int> pi;
char tr(char c);
void kmp();
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> a >> b;
  --n;
  kmp();
  cout << (pi.back() > 0 ? "NO" : "YES") << endl;
  return 0;
}
void kmp() {
  s = a + b;
  for (int i = 0; i < n - i - 1; ++i) swap(s[i], s[n - i - 1]);
  for (int i = 0; i < n; ++i) s[i] = tr(s[i]);
  n = n + n;
  pi.assign(n, 0);
  for (int i = 1; i < n; ++i) {
    int j = pi[i - 1];
    while (j > 0 && s[i] != s[j]) j = pi[j - 1];
    if (s[i] == s[j]) ++j;
    pi[i] = j;
  }
  n /= 2;
}
char tr(char c) {
  if (c == 'E') return 'W';
  if (c == 'W') return 'E';
  if (c == 'S') return 'N';
  if (c == 'N') return 'S';
}
