#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000005;
int n;
char s1[maxn], s2[maxn];
int main() {
  scanf("%d%s%s", &n, s1 + 1, s2 + 1);
  reverse(s1 + 1, s1 + n);
  for (int i = 1; i < n; ++i) {
    if (s1[i] == 'N')
      s1[i] = 'S';
    else if (s1[i] == 'S')
      s1[i] = 'N';
    else if (s1[i] == 'W')
      s1[i] = 'E';
    else
      s1[i] = 'W';
  }
  unsigned long long h1 = 0, h2 = 0, fa = 1;
  for (int i = 1; i < n; ++i) {
    h1 = h1 + s1[i] * fa;
    h2 = h2 * 233u + s2[n - i];
    fa *= 233u;
    if (h1 == h2) return puts("NO"), 0;
  }
  puts("YES");
  return 0;
}
