#include <bits/stdc++.h>
using namespace std;
const unsigned long long seed = 233333;
char s1[1000003], s2[1000003];
int n;
int main() {
  cin >> n >> (s1 + 1) >> (s2 + 1);
  n--;
  for (int i = 1; i <= n; i++) {
    if (s2[i] == 'N') {
      s2[i] = 'S';
    } else if (s2[i] == 'S') {
      s2[i] = 'N';
    } else if (s2[i] == 'W') {
      s2[i] = 'E';
    } else {
      s2[i] = 'W';
    }
  }
  unsigned long long v1 = 0, v2 = 0, lei = 1;
  for (int i = n; i >= 1; i--) {
    v1 = v1 * seed + (s2[i] - 'A');
    v2 = v2 + (s1[i] - 'A') * lei;
    if (v1 == v2) {
      cout << "NO" << endl;
      return 0;
    }
    lei = lei * seed;
  }
  cout << "YES" << endl;
  return 0;
}
