#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 10;
const long long int MOD = 1e9 + 7;
const long long int p = 3137;
long long int pot[MAX];
long long int h1[MAX];
long long int h2[MAX];
char a[MAX];
char b[MAX];
int n;
long long int sum(long long int a, long long int b) { return (a + b) % MOD; }
long long int sub(long long int a, long long int b) {
  return (a - b + MOD) % MOD;
}
long long int mult(long long int a, long long int b) { return (a * b) % MOD; }
int main() {
  scanf("%d", &n);
  scanf("%s", a);
  scanf("%s", b);
  --n;
  pot[0] = 1;
  for (int i = 1; i < MAX; ++i) pot[i] = mult(pot[i - 1], p);
  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] == 'E')
      a[i] = 'W';
    else if (a[i] == 'W')
      a[i] = 'E';
  }
  h1[0] = a[0];
  for (int i = 1; i < n; ++i) {
    h1[i] = sum(mult(h1[i - 1], p), a[i]);
  }
  h2[n - 1] = b[n - 1];
  for (int i = n - 2; i >= 0; --i) {
    h2[i] = sum(mult(h2[i + 1], p), b[i]);
  }
  for (int i = 0; i < n; ++i) {
    long long int h;
    if (i) {
      h = sub(h1[n - 1], mult(h1[i - 1], pot[n - 1 - i + 1]));
    } else
      h = h1[n - 1];
    if (h == h2[i]) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
}
