#include <bits/stdc++.h>
using namespace std;
int dfa[1000010][26];
void build(string &s) {
  memset(dfa, 0, sizeof dfa);
  int x = 0;
  for (int i = 0; i < s.size(); i++) {
    for (int c = 0; c < 26; c++) dfa[i][c] = dfa[x][c];
    x = dfa[i][s[i] - 'A'];
    dfa[i][s[i] - 'A'] = i + 1;
  }
  for (int c = 0; c < 26; c++) dfa[s.size()][c] = dfa[x][c];
}
bool search(string &s) {
  int x = 0;
  for (int i = 0; i < s.size(); i++) x = dfa[x][s[i] - 'A'];
  return x;
}
int main() {
  int n;
  string a, b;
  while (cin >> n >> a >> b) {
    reverse(a.begin(), a.end());
    for (int i = 0; i < n; i++) {
      if (a[i] == 'N')
        a[i] = 'S';
      else if (a[i] == 'S')
        a[i] = 'N';
      else if (a[i] == 'E')
        a[i] = 'W';
      else
        a[i] = 'E';
    }
    build(a);
    search(b) ? cout << "NO\n" : cout << "YES\n";
  }
  return 0;
}
