import java.io.*;

public class Main {
    final static String dirs = "NSEW";

    public static void solve(Input in, PrintWriter out) throws IOException {
        int n = in.nextInt() - 1;
        String s1 = in.next();
        String s2 = in.next();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; ++i) {
            sb.append(dirs.charAt(dirs.indexOf(s1.charAt(n - i - 1)) ^ 1));
        }
        sb.append(s2);
        int[] p = new int[2 * n];
        for (int i = 1; i < 2 * n; ++i) {
            p[i] = p[i - 1];
            while (p[i] != 0 && sb.charAt(i) != sb.charAt(p[i])) {
                p[i] = p[p[i] - 1];
            }
            if (sb.charAt(i) == sb.charAt(p[i])) {
                p[i]++;
            }
        }
        out.println(p[2 * n - 1] == 0 ? "YES" : "NO");
    }

    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        solve(new Input(new BufferedReader(new InputStreamReader(System.in))), out);
        out.close();
    }

    static class Input {
        BufferedReader in;
        StringBuilder sb = new StringBuilder();

        public Input(BufferedReader in) {
            this.in = in;
        }

        public Input(String s) {
            this.in = new BufferedReader(new StringReader(s));
        }

        public String next() throws IOException {
            sb.setLength(0);
            while (true) {
                int c = in.read();
                if (c == -1) {
                    return null;
                }
                if (" \n\r\t".indexOf(c) == -1) {
                    sb.append((char)c);
                    break;
                }
            }
            while (true) {
                int c = in.read();
                if (c == -1 || " \n\r\t".indexOf(c) != -1) {
                    break;
                }
                sb.append((char)c);
            }
            return sb.toString();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }
}
