#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:667772160")
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
char str1[1000000 + 7], str2[1000000 + 7];
int lps[1000000 + 7], n;
void prefix() {
  reverse(str2, str2 + n);
  lps[0] = 0;
  int k = 0;
  for (int i = 1; i < n; i++) {
    while (k > 0 and str2[i] != str2[k]) k = lps[k - 1];
    if (str2[i] == str2[k]) k++;
    lps[i] = k;
  }
}
bool isok() {
  for (int i = 0; i < n; i++) {
    if (str1[i] == 'S')
      str1[i] = 'N';
    else if (str1[i] == 'N')
      str1[i] = 'S';
    else if (str1[i] == 'E')
      str1[i] = 'W';
    else
      str1[i] = 'E';
  }
  prefix();
  int k = 0;
  for (int i = 0; i < n; i++) {
    while (k > 0 and str1[i] != str2[k]) k = lps[k - 1];
    if (str1[i] == str2[k]) k++;
  }
  return (bool)(k > 0);
}
int main() {
  scanf("%d", &n);
  scanf("%s %s", str1, str2);
  n = strlen(str1);
  if (isok())
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
