#include <bits/stdc++.h>
using namespace std;
int n, pre[1000005], dist[1000005];
char a[1000005], b[1000005];
void getpre(char str[]) {
  int fix = 0;
  for (int i = 2; str[i]; ++i) {
    while (fix && str[fix + 1] != str[i]) fix = pre[fix];
    if (str[fix + 1] == str[i]) ++fix;
    pre[i] = fix;
  }
}
void match(char str1[], char str2[]) {
  int fix = 0;
  for (int i = 1; str2[i]; ++i) {
    while (fix && str1[fix + 1] != str2[i]) fix = pre[fix];
    if (str1[fix + 1] == str2[i]) ++fix;
    dist[i] = fix;
  }
}
int main() {
  cin >> n;
  --n;
  scanf("%s%s", a + 1, b + 1);
  reverse(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i)
    if (a[i] == 'N')
      a[i] = 'S';
    else if (a[i] == 'S')
      a[i] = 'N';
    else if (a[i] == 'E')
      a[i] = 'W';
    else if (a[i] == 'W')
      a[i] = 'E';
  getpre(a);
  match(a, b);
  if (dist[n] == 0)
    puts("YES");
  else
    puts("NO");
  return 0;
}
