#include <bits/stdc++.h>
using namespace std;
void base() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long mod = 1e9 + 7;
long long h1[1000020], h2[1000020], pp[1000020];
void solve() {
  int n;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  for (int i = 0; i < s2.size(); ++i) {
    if (s2[i] == 'N')
      s2[i] = 'S';
    else if (s2[i] == 'S')
      s2[i] = 'N';
    else if (s2[i] == 'E')
      s2[i] = 'W';
    else
      s2[i] = 'E';
  }
  reverse(s2.begin(), s2.end());
  long long p = 31;
  long long mult = pp[0] = 1;
  int siz = s1.size();
  for (int i = 0; i < siz; ++i) {
    mult = (mult * p) % mod;
    pp[i + 1] = mult;
    h1[i + 1] = (h1[i] + (mult * (s1[i] - 'A'))) % mod;
    h2[i + 1] = (h2[i] + (mult * (s2[i] - 'A'))) % mod;
  }
  bool same = 0;
  for (int i = 1; i < siz + 1; ++i) {
    long long hh2 = (h2[i] * pp[siz - i]) % mod;
    long long hh1 = (h1[siz] - h1[siz - i] + mod) % mod;
    if (hh1 == hh2) same = 1;
  }
  if (same)
    cout << "NO\n";
  else
    cout << "YES\n";
}
int main() {
  base();
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
