#include <bits/stdc++.h>
using namespace std;
int n;
string a, b;
unordered_map<char, char> mirrorMap = {
    {'N', 'S'},
    {'S', 'N'},
    {'E', 'W'},
    {'W', 'E'},
};
string mirror(string s) {
  for (int i = 0; i < n; i++) {
    s[i] = mirrorMap[s[i]];
  }
  return s;
}
void kmp(const string& s, vector<int>& pi, int d) {
  int cur = 0;
  for (int i = 2; i < d; i++) {
    while (cur > 0 && s[cur + 1] != s[i]) {
      cur = pi[cur];
    }
    if (s[cur + 1] == s[i]) cur++;
    pi[i] = cur;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> a >> b;
  n--;
  reverse(b.begin(), b.end());
  string s = "$" + mirror(b) + a;
  int d = 2 * n + 1;
  vector<int> pi(d);
  kmp(s, pi, d);
  if (pi[d - 1] > 0) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
  }
  return 0;
}
