#include <bits/stdc++.h>
using namespace std;
char a[1000010], b[1000010];
int phi[1000010];
inline void rev(char &a) {
  if (a == 'N')
    a = 'S';
  else if (a == 'S')
    a = 'N';
  else if (a == 'W')
    a = 'E';
  else
    a = 'W';
}
int main() {
  int n;
  scanf("%d\n", &n);
  gets(a + 1);
  gets(b + 1);
  b[n] = ' ';
  reverse(a + 1, a + n);
  rev(a[1]);
  for (int i = 2; i < n; ++i) {
    rev(a[i]);
    int k = phi[i - 1];
    while (k && a[k + 1] != a[i]) k = phi[k];
    if (a[i] == a[k + 1]) phi[i] = k + 1;
  }
  int k = 0;
  for (int i = 1; i < n; ++i) {
    while (k && a[k + 1] != b[i]) k = phi[k];
    if (b[i] == a[k + 1])
      ++k;
    else
      k = 0;
  }
  if (k)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
