#include <bits/stdc++.h>
using namespace std;
const int M = 2038074743;
char opposite(char c) {
  switch (c) {
    case 'N':
      return 'S';
      break;
    case 'S':
      return 'N';
      break;
    case 'E':
      return 'W';
      break;
    case 'W':
      return 'E';
      break;
    default:
      return 'x';
  }
}
int val(char c) {
  switch (c) {
    case 'N':
      return 0;
      break;
    case 'S':
      return 1;
      break;
    case 'E':
      return 2;
      break;
    case 'W':
      return 3;
      break;
    default:
      return -1;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  transform(b.begin(), b.end(), b.begin(), opposite);
  long long hash1 = 0, hash2 = 0, base = 1;
  for (int i = 0; i < n - 1; i++) {
    hash1 = (hash1 + base * val(a[i])) % M;
    base = (base * 4) % M;
    hash2 = (hash2 * 4 + val(b[i])) % M;
    if (hash1 == hash2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
