#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& fout, const vector<T>& vec) {
  for (size_t i = 0; i < vec.size(); ++i) {
    fout << vec[i] << ' ';
  }
  return fout;
}
template <class T>
istream& operator>>(istream& fin, vector<T>& vec) {
  for (size_t i = 0; i < vec.size(); ++i) {
    cin >> vec[i];
  }
  return fin;
}
map<char, char>& get_map() {
  static map<char, char> result = {
      {'N', 'S'}, {'S', 'N'}, {'E', 'W'}, {'W', 'E'}};
  return result;
}
string reverse_path(const string& arg) {
  const auto& m = get_map();
  string result = "";
  for (const auto& ch : arg) {
    result.push_back(m.at(ch));
  }
  return result;
}
constexpr static int prime = 2000000011;
vector<uint64_t> get_primes(int n) {
  vector<uint64_t> result;
  uint64_t current = 1;
  result.push_back(current);
  for (int i = 0; i < n; ++i) {
    current *= prime;
    result.push_back(current);
  }
  return result;
}
vector<uint64_t> hash_string(const string& input) {
  vector<uint64_t> hashes;
  uint64_t current = 0;
  hashes.push_back(current);
  for (size_t i = 0; i < input.size(); ++i) {
    current = current * prime + input[i];
    hashes.push_back(current);
  }
  return hashes;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  --n;
  string a, b;
  cin >> a >> b;
  a = reverse_path(a);
  reverse((a).begin(), (a).end());
  auto h1 = hash_string(a);
  auto h2 = hash_string(b);
  set<int> s(h1.begin() + 1, h1.end());
  multimap<uint64_t, size_t> bim;
  for (size_t i = 1; (int)i <= n; ++i) {
    bim.insert({h1[i], i});
  }
  auto primes = get_primes(n);
  for (int i = 0; i < n; ++i) {
    uint64_t suf_hash = h2.back() - h2[i] * primes[n - i];
    if (bim.find(suf_hash) != bim.end()) {
      auto it = bim.find(suf_hash);
      while (it->first == suf_hash) {
        if (a.substr(0, it->second) == b.substr(i, n)) {
          cout << "NO"
               << "\n";
          return 0;
        }
        ++it;
      }
    }
  }
  cout << "YES"
       << "\n";
  return 0;
}
