#include <bits/stdc++.h>
using namespace std;
const int MAX_STRING_LENGTH = 2e6 + 10;
struct _io {
  char buff[MAX_STRING_LENGTH];
  _io &operator>>(int &x) {
    scanf("%d", &x);
    return *this;
  }
  _io &operator>>(long long &x) {
    scanf("%lld", &x);
    return *this;
  }
  _io &operator>>(float &x) {
    scanf("%f", &x);
    return *this;
  }
  _io &operator>>(double &x) {
    scanf("%lf", &x);
    return *this;
  }
  _io &operator>>(long double &x) {
    scanf("%Lf", &x);
    return *this;
  }
  _io &operator>>(char &c) {
    do {
      scanf("%c", &c);
    } while (c == ' ' || c == '\n');
    return *this;
  }
  _io &operator>>(char *s) {
    scanf("%s", s);
    return *this;
  }
  _io &operator>>(string &s) {
    scanf("%s", buff);
    s = string(buff, strlen(buff));
    return *this;
  }
  _io &operator<<(const int x) {
    printf("%d", x);
    return *this;
  }
  _io &operator<<(const long long x) {
    printf("%lld", x);
    return *this;
  }
  _io &operator<<(const float x) {
    printf("%f", x);
    return *this;
  }
  _io &operator<<(const double &x) {
    printf("%lf", x);
    return *this;
  }
  _io &operator<<(const long double &x) {
    printf("%Lf", x);
    return *this;
  }
  _io operator<<(const char &c) {
    printf("%c", c);
    return *this;
  }
  _io &operator<<(const string &s) {
    printf("%s", s.c_str());
    return *this;
  }
  _io &operator<<(const char *s) {
    printf("%s", s);
    return *this;
  }
} io;
const int maxn = 2e6 + 10;
int p[maxn];
char mp[256], m[maxn];
int main() {
  mp['N'] = 'S';
  mp['S'] = 'N';
  mp['E'] = 'W';
  mp['W'] = 'E';
  int n;
  io >> n;
  --n;
  string s;
  io >> s;
  for (int i = 0; i < n; ++i) {
    m[n - i - 1] = mp[s[i]];
  }
  m[n] = 'a';
  io >> s;
  for (int i = 0; i < n; ++i) {
    m[n + 1 + i] = s[i];
  }
  n = 2 * n + 1;
  int f = -1;
  p[0] = -1;
  for (int i = 1; i < n; ++i) {
    while (m[i] != m[f + 1] && f != -1) {
      f = p[f];
    }
    if (m[i] == m[f + 1]) ++f;
    p[i] = f;
  }
  if (f != -1)
    io << "NO";
  else
    io << "YES";
  return 0;
}
