#include <bits/stdc++.h>
using namespace std;
const int N = 1000000 + 5;
int n;
char x, a[N], b[N];
long long ha[N][2], hb[N][2], hc[2], hc_pow[2][N];
char reverse_direction(char x) {
  if (x == 'N') return 'S';
  if (x == 'S') return 'N';
  if (x == 'W') return 'E';
  return 'W';
}
int main() {
  scanf("%d\n", &n);
  n--;
  for (int i = 1; i <= n; i++) scanf("%c", &a[i]);
  scanf("\n");
  for (int i = 1; i <= n; i++) scanf("%c", &x), b[i] = reverse_direction(x);
  hc_pow[0][0] = hc_pow[1][0] = 1LL;
  hc[0] = 20000623LL;
  hc[1] = 19260817LL;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= 1; j++) hc_pow[j][i] = hc_pow[j][i - 1] * hc[j];
  ha[0][0] = ha[0][1] = hb[n + 1][0] = hb[n + 1][1] = 0LL;
  for (int i = n; i >= 1; i--)
    for (int j = 0; j <= 1; j++)
      ha[i][j] = ha[i + 1][j] + (long long)a[i] * hc_pow[j][n - i];
  for (int i = n; i >= 1; i--)
    for (int j = 0; j <= 1; j++)
      hb[i][j] = hb[i + 1][j] * hc[j] + (long long)b[i];
  bool ans = true;
  for (int i = 1; i <= n; i++)
    if (ha[i][0] == hb[i][0] && ha[i][1] == hb[i][1]) {
      ans = false;
      break;
    }
  puts(ans ? "YES" : "NO");
  return 0;
}
