#include <bits/stdc++.h>
using namespace std;
long long p = 1000000007;
char A[1000010], B[1000010];
long long converty(char c) {
  if (c == 'N') return 0;
  if (c == 'S') return 3;
  if (c == 'E') return 2;
  if (c == 'W') return 1;
}
long long convertx(char c) { return 3 - converty(c); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  scanf("%d", &n);
  A[n] = '\0';
  B[n] = '\0';
  scanf("%s", A);
  scanf("%s", B);
  int m = n - 1;
  long long x = 0;
  long long y = 0;
  long long r = 4;
  long long powr[1000010];
  powr[0] = 1;
  for (int i = 1; i <= 1000005; i++) {
    powr[i] = r * powr[i - 1];
    while (powr[i] > p) powr[i] -= p;
  }
  int curr = m - 1;
  while (curr >= 0) {
    x = r * x + convertx(A[curr]);
    while (x > p) x -= p;
    y += powr[m - 1 - curr] * converty(B[curr]);
    while (y > p) y -= p;
    if (x == y) {
      printf("NO\n");
      return 0;
    }
    curr -= 1;
  }
  printf("YES\n");
  return 0;
}
