#include <bits/stdc++.h>
using namespace std;
void failure_function(vector<int>& l_pref, string& s) {
  int i, j;
  l_pref[0] = -1;
  for (i = 1; i < l_pref.size(); i++) {
    j = i - 1;
    while ((j != -1) && (s[i] != s[l_pref[j] + 1])) {
      j = l_pref[j];
    }
    l_pref[i] = (j == -1) ? ((s[i] == s[0]) ? 0 : -1) : (l_pref[j] + 1);
  }
}
void reverse(string& s) {
  for (int i = 0; i < s.size(); i++) {
    switch (s[i]) {
      case 'S':
        s[i] = 'N';
        break;
      case 'E':
        s[i] = 'W';
        break;
      case 'W':
        s[i] = 'E';
        break;
      case 'N':
        s[i] = 'S';
        break;
    }
  }
  for (int i = 0; i < ((s.size() >> 1) + (s.size() & 1)); i++) {
    char temp = s[i];
    s[i] = s[s.size() - i - 1];
    s[s.size() - i - 1] = temp;
  }
}
string s1, s2;
int main() {
  int n;
  vector<int> l_pref;
  cin >> n >> s1 >> s2;
  reverse(s2);
  s2.append("$");
  s2.append(s1);
  l_pref.resize(s2.size(), 0);
  failure_function(l_pref, s2);
  if (l_pref[s2.size() - 1] == -1) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}
