#include <bits/stdc++.h>
using namespace std;
const long long A1 = 471853462;
const long long B1 = 145632721;
const long long A2 = 745637263;
const long long B2 = 1567263477;
int n;
string s1, s2;
long long h1[1010101], h2[1010101];
long long asd1[1010101], asd2[1010101];
void hashi() {
  asd1[0] = 1;
  asd2[0] = 1;
  for (int i = 1; i < n - 1; i++) {
    asd1[i] = (asd1[i - 1] * A1) % B1;
    asd2[i] = (asd2[i - 1] * A2) % B2;
  }
  for (int i = 0; i < n - 1; i++) {
    if (s1[i] == 'N') {
      h1[i] = 1;
      h2[i] = 1;
    } else if (s1[i] == 'S') {
      h1[i] = 2;
      h2[i] = 2;
    } else if (s1[i] == 'W') {
      h1[i] = 3;
      h2[i] = 3;
    } else if (s1[i] == 'E') {
      h1[i] = 4;
      h2[i] = 4;
    }
  }
  for (int i = 1; i < n - 1; i++) {
    h1[i] += (h1[i - 1] * A1) % B1;
    h2[i] += (h2[i - 1] * A2) % B2;
    h1[i] %= B1;
    h2[i] %= B2;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> s1 >> s2;
  hashi();
  long long lol1 = 0;
  long long lol2 = 0;
  for (int i = n - 2; i >= 0; i--) {
    lol1 *= A1;
    lol2 *= A2;
    if (s2[i] == 'S') {
      lol1 += 1;
      lol2 += 1;
    } else if (s2[i] == 'N') {
      lol1 += 2;
      lol2 += 2;
    } else if (s2[i] == 'E') {
      lol1 += 3;
      lol2 += 3;
    } else if (s2[i] == 'W') {
      lol1 += 4;
      lol2 += 4;
    }
    lol1 %= B1;
    lol2 %= B2;
    long long ha1 = h1[n - 2];
    long long ha2 = h2[n - 2];
    if (i > 0) {
      ha1 -= (h1[i - 1] * asd1[n - i - 1]) % B1;
      ha2 -= (h2[i - 1] * asd2[n - i - 1]) % B2;
      ha1 = ((ha1 % B1) + B1) % B1;
      ha2 = ((ha2 % B2) + B2) % B2;
    }
    if (lol1 == ha1 && lol2 == ha2) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
}
