#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct Promotion {};
template <>
struct Promotion<char> {};
template <>
struct Promotion<int8_t> {};
template <>
struct Promotion<int16_t> {};
template <>
struct Promotion<int32_t> {};
template <>
struct Promotion<int64_t> {};
template <>
struct Promotion<uint8_t> {};
template <>
struct Promotion<uint16_t> {};
template <>
struct Promotion<uint32_t> {};
template <>
struct Promotion<uint64_t> {};
template <>
struct Promotion<float> {};
template <>
struct Promotion<double> {};
const int N = (int)1e6 + 6;
string s, t;
int n;
int z[N * 2];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> s >> t;
  --n;
  for (auto& c : t) {
    if (c == 'N')
      c = 'S';
    else if (c == 'S')
      c = 'N';
    else if (c == 'E')
      c = 'W';
    else if (c == 'W')
      c = 'E';
  }
  reverse((t).begin(), (t).end());
  t += s;
  int l = 0, r = 0;
  z[0] = 0;
  for (auto i = (1); i < (2 * n); i++) {
    if (i <= r) z[i] = min(z[i - l], r - i + 1);
    while (i + z[i] < 2 * n && t[z[i]] == t[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) {
      l = i;
      r = i + z[i] - 1;
    }
  }
  for (auto i = (n); i < (2 * n); i++) {
    if (z[i] == 2 * n - i) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
