#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 50;
char s[N];
int dp[N];
void check(char *s, int len) {
  for (int i = 0; i < len; ++i) {
    if (s[i] == 'N')
      s[i] = 'S';
    else if (s[i] == 'W')
      s[i] = 'E';
    else if (s[i] == 'S')
      s[i] = 'N';
    else if (s[i] == 'E')
      s[i] = 'W';
  }
  for (int l = 0, r = len - 1; l < r; ++l, --r) {
    swap(s[l], s[r]);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  --n;
  scanf("%s%s", s, s + n + 1);
  s[n] = ' ';
  check(s, n);
  int len = n * 2 + 1;
  dp[0] = -1;
  for (int i = 1; i < len; ++i) {
    int j = dp[i - 1];
    while (j != -1 && s[j + 1] != s[i]) j = dp[j];
    if (s[j + 1] == s[i]) ++j;
    dp[i] = j;
  }
  puts(dp[len - 1] == -1 ? "YES" : "NO");
}
