#include <bits/stdc++.h>
using namespace std;
char get(char c) {
  if (c == 'N') return 'S';
  if (c == 'S') return 'N';
  if (c == 'W') return 'E';
  if (c == 'E') return 'W';
}
int fail[2000005];
int n;
string s1, s2;
int main() {
  cin >> n >> s1 >> s2;
  reverse(s2.begin(), s2.end());
  for (char& c : s2) c = get(c);
  string str = s2 + "$" + s1;
  for (int i = 1, j = 0; i < str.size(); i++) {
    while (str[i] != str[j] && j > 0) j = fail[j - 1];
    if (str[i] == str[j]) ++j;
    fail[i] = j;
  }
  puts(fail[str.size() - 1] ? "NO" : "YES");
}
