#include <bits/stdc++.h>
using namespace std;
const int MAX = 200000;
int n;
string s1, s2;
int main() {
  cin >> n >> s1 >> s2;
  int K = 7;
  long long H = 0, HH = 0, D = 1;
  n--;
  for (int(i) = (1); i < (n + 1); ++(i)) {
    int p = 0, pp = 0;
    if (s1[n - i] == 'N') p = 1;
    if (s1[n - i] == 'S') p = 4;
    if (s1[n - i] == 'E') p = 2;
    if (s1[n - i] == 'W') p = 3;
    H = H * K + p;
    if (s2[n - i] == 'N') pp = 4;
    if (s2[n - i] == 'S') pp = 1;
    if (s2[n - i] == 'E') pp = 3;
    if (s2[n - i] == 'W') pp = 2;
    HH += D * (pp);
    D *= 7;
    if (H == HH) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
}
