#include <bits/stdc++.h>
using namespace std;
inline int getInt() {
  int ret = 0;
  char ch = ' ';
  bool flag = 0;
  while (!(ch >= '0' && ch <= '9')) {
    if (ch == '-') flag ^= 1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    ret = ret * 10 + ch - '0';
    ch = getchar();
  }
  return flag ? -ret : ret;
}
const int N = 1000010;
int n;
char s1[N], s2[N];
int nex[N];
inline void input() {
  cin >> n;
  n--;
  cin >> (s1 + 1);
  cin >> (s2 + 1);
}
inline void solve() {
  reverse(s2 + 1, s2 + 1 + n);
  for (int i = 1; i <= n; i++)
    if (s1[i] == 'E')
      s1[i] = 'W';
    else if (s1[i] == 'W')
      s1[i] = 'E';
    else if (s1[i] == 'N')
      s1[i] = 'S';
    else if (s1[i] == 'S')
      s1[i] = 'N';
  nex[1] = 0;
  for (int i = 2, j = 0; i <= n; i++) {
    while (j && s2[j + 1] != s2[i]) j = nex[j];
    if (s2[j + 1] == s2[i]) j++;
    nex[i] = j;
  }
  int x = 0;
  for (int i = 1; i <= n; i++) {
    while (x && s1[i] != s2[x + 1]) x = nex[x];
    if (s1[i] == s2[x + 1]) x++;
  }
  if (x)
    cout << "NO\n";
  else
    cout << "YES\n";
}
int main() {
  ios::sync_with_stdio(0);
  input();
  solve();
  return 0;
}
