#include <bits/stdc++.h>
using namespace std;
void setup() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(15);
}
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
char reverse(char c) {
  switch (c) {
    case 'N':
      return 'S';
    case 'W':
      return 'E';
    case 'E':
      return 'W';
    case 'S':
      return 'N';
  }
}
int automata_pre[1000005];
int main() {
  int n;
  string a, b, rev;
  cin >> n >> a >> b;
  n--;
  for (int i = 0; i < n; i++) {
    rev.append(1, reverse(a[n - 1 - i]));
  }
  int i = 0, j;
  j = automata_pre[0] = -1;
  while (i < rev.length()) {
    while (j >= 0 and rev[i] != rev[j]) j = automata_pre[j];
    automata_pre[++i] = ++j;
  }
  i = j = 0;
  while (j < b.length()) {
    if (rev[i] != b[j])
      i = automata_pre[i];
    else
      i++, j++;
    if (i == -1) i++, j++;
  }
  if (i == 0)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
