#include <bits/stdc++.h>
using namespace std;
int n;
int nx[1000005];
string A, B, C;
void Init(string S) {
  memset(nx, 0, sizeof(nx));
  for (int i = 1; i < S.length(); i++) {
    int j = nx[i];
    while (j && S[i] != S[j]) j = nx[j];
    if (S[i] == S[j])
      nx[i + 1] = j + 1;
    else
      nx[i + 1] = 0;
  }
}
bool Find(string A, string B) {
  Init(B);
  int j = 0;
  for (int i = 0; i < A.length(); i++) {
    while (j && A[i] != B[j]) j = nx[j];
    if (A[i] == B[j]) j++;
    if (i + 1 == A.length()) return (j > 0);
  }
  return false;
}
int main() {
  scanf("%d", &n);
  n--;
  cin >> A >> B;
  for (int i = 0; i < n; i++) {
    if (A[i] == 'S')
      A[i] = 'N';
    else if (A[i] == 'N')
      A[i] = 'S';
    else if (A[i] == 'W')
      A[i] = 'E';
    else
      A[i] = 'W';
  }
  for (int i = 0; i < n; i++) C += A[n - i - 1];
  bool ans = Find(B, C);
  if (ans == false)
    puts("YES");
  else
    puts("NO");
  return 0;
}
