#include <bits/stdc++.h>
using namespace std;
template <class T, class S>
ostream& operator<<(ostream& os, const pair<T, S>& v) {
  return os << "(" << v.first << ", " << v.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (int i = int(0); i <= int((static_cast<int>((v).size())) - 1); ++i) {
    if (i) os << ", ";
    os << v[i];
  }
  return os << "]";
}
template <class T>
bool setmax(T& _a, T _b) {
  if (_a < _b) {
    _a = _b;
    return true;
  }
  return false;
}
template <class T>
bool setmin(T& _a, T _b) {
  if (_b < _a) {
    _a = _b;
    return true;
  }
  return false;
}
template <class T>
T gcd(T _a, T _b) {
  return _b == 0 ? _a : gcd(_b, _a % _b);
}
int main() {
  int n;
  string a, b;
  cin >> n >> a >> b;
  reverse((b).begin(), (b).end());
  for (char& ch : b) {
    if (ch == 'N')
      ch = 'S';
    else if (ch == 'S')
      ch = 'N';
    else if (ch == 'W')
      ch = 'E';
    else if (ch == 'E')
      ch = 'W';
  }
  vector<int> fail(static_cast<int>((b).size()) + 1);
  int j = fail[0] = -1;
  for (int i = int(0); i <= int((static_cast<int>((b).size())) - 1); ++i) {
    while (j >= 0 && b[i] != b[j]) j = fail[j];
    fail[i + 1] = ++j;
  }
  j = 0;
  for (int i = int(0); i <= int((static_cast<int>((a).size())) - 1); ++i) {
    while (j >= 0 && a[i] != b[j]) j = fail[j];
    ++j;
  }
  printf("%s\n", j > 0 ? "NO" : "YES");
  return 0;
}
