#include <bits/stdc++.h>
using namespace std;
char s[2345678];
int p[2345678];
int main() {
  int n;
  scanf("%d", &n);
  --n;
  scanf("%s", s);
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'N')
      s[i] = 'S';
    else if (s[i] == 'S')
      s[i] = 'N';
    else if (s[i] == 'E')
      s[i] = 'W';
    else if (s[i] == 'W')
      s[i] = 'E';
  }
  for (int i = 0; i < n / 2; ++i) {
    swap(s[i], s[n - i - 1]);
  }
  scanf("%s", s + n);
  p[0] = 0;
  for (int i = 1; i < n + n; ++i) {
    int j = p[i - 1];
    while (j > 0 && s[i] != s[j]) {
      j = p[j - 1];
    }
    p[i] = j + (s[i] == s[j]);
  }
  int k = p[n + n - 1];
  while (k > n) k = p[k - 1];
  puts(k == 0 ? "YES" : "NO");
  return 0;
}
