#include <bits/stdc++.h>
using namespace std;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long lcm(long long a, long long b) { return (a * (b / gcd(a, b))); }
const int N = 1000001;
int f[2 * N], n;
string a, b, s;
void kmp() {
  for (int i = 1, k = 0; i < s.length(); ++i) {
    while (k > 0 && s[k] != s[i]) k = f[k - 1];
    if (s[k] == s[i])
      f[i] = ++k;
    else
      f[i] = k;
  }
}
char op(char c) {
  if (c == 'S') return 'N';
  if (c == 'N') return 'S';
  if (c == 'W') return 'E';
  if (c == 'E') return 'W';
}
void solution() {
  cin >> n;
  n--;
  cin >> a >> b;
  reverse((a).begin(), (a).end());
  for (int i = 0; i < int(n); i++) a[i] = op(a[i]);
  s = a + "@" + b;
  kmp();
  if (f[2 * n] != 0)
    cout << "NO";
  else
    cout << "YES";
}
int main() {
  double beg = clock();
  ios::sync_with_stdio(false);
  solution();
  return 0;
}
