#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 5;
const long long mod = 998244353;
const long long base = 317;
char opp[maxn];
long long mu[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (fopen("perfect.inp", "r")) {
    freopen("perfect.inp", "r", stdin);
    freopen("perfect.out", "w", stdout);
  }
  opp['N'] = 'S';
  opp['S'] = 'N';
  opp['E'] = 'W';
  opp['W'] = 'E';
  long long n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  s = " " + s;
  t = " " + t;
  long long nw = 0;
  long long nw1 = 0;
  mu[0] = 1;
  for (int i = 1; i <= n; i++) mu[i] = (mu[i - 1] * base) % mod;
  for (int i = n - 1; i >= 1; i--) {
    nw = (nw * base + s[i] - 'A' + 100) % mod;
    nw1 = ((opp[t[i]] - 'A' + 100) * mu[n - i - 1] + nw1) % mod;
    if (nw == nw1) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
}
