#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long mod = 2147483647;
char s[1000100], t[1000100];
long long h11[1000100], h12[1000100], h21[1000100], h22[1000100], p1[1000100],
    p2[1000100];
int n;
inline int get(char c) {
  return c == 'N' ? 1 : (c == 'S' ? 4 : (c == 'E' ? 3 : 2));
}
long long get11(int l, int r) {
  long long res = mod + h11[r] - ((h11[l - 1] * p1[r - l + 1]) & mod);
  return res & mod;
}
long long get12(int l, int r) {
  long long res = mod + h12[r] - ((h12[l - 1] * p2[r - l + 1]) & mod);
  return res & mod;
}
long long get21(int l, int r) {
  long long res = mod + h21[r] - ((h21[l - 1] * p1[r - l + 1]) & mod);
  return res & mod;
}
long long get22(int l, int r) {
  long long res = mod + h22[r] - ((h22[l - 1] * p2[r - l + 1]) & mod);
  return res & mod;
}
int main() {
  scanf("%d", &n);
  n--;
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  reverse(t + 1, t + 1 + n);
  p1[0] = p2[0] = 1;
  for (int i = 1; i <= n; i++) {
    p1[i] = p1[i - 1] * 23;
    p1[i] &= mod;
    p2[i] = p2[i - 1] * 29;
    p2[i] &= mod;
    h11[i] = h11[i - 1] * 23 + get(s[i]);
    h11[i] &= mod;
    h12[i] = h12[i - 1] * 29 + get(s[i]);
    h12[i] &= mod;
    h21[i] = h21[i - 1] * 23 + 5 - get(t[i]);
    h21[i] &= mod;
    h22[i] = h22[i - 1] * 29 + 5 - get(t[i]);
    h22[i] &= mod;
  }
  for (int i = 1; i <= n; i++) {
    if (get11(i, n) == get21(1, n - i + 1) &&
        get22(1, n - i + 1) == get12(i, n)) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  return 0;
}
