#include <bits/stdc++.h>
using namespace std;
void Print() { cout << endl; }
template <typename T1, typename... T>
void Print(const T1 &t1, const T &...t) {
  cout << t1 << " ";
  Print(t...);
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
const int N = 1000005;
int n;
char a[N], b[N];
int p[N];
void kmp_preprocess() {
  int k = p[1] = 0;
  for (int i = 2; i <= n - 1; ++i) {
    while (k > 0 && a[k + 1] != a[i]) {
      k = p[k];
    }
    if (a[k + 1] == a[i]) ++k;
    p[i] = k;
  }
}
bool check() {
  reverse(a + 1, a + n);
  for (int i = 1; i <= n - 1; ++i) {
    if (a[i] == 'N')
      a[i] = 'S';
    else if (a[i] == 'S')
      a[i] = 'N';
    else if (a[i] == 'E')
      a[i] = 'W';
    else
      a[i] = 'E';
  }
  kmp_preprocess();
  int k = 0;
  for (int i = 1; i <= n - 1; ++i) {
    while (k > 0 && a[k + 1] != b[i]) k = p[k];
    if (a[k + 1] == b[i]) ++k;
    if (i == n - 1 && k > 0) return false;
    if (k == n - 1) k = p[k];
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> (a + 1) >> (b + 1);
  if (check())
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
