#include <bits/stdc++.h>
using namespace std;
const int N = 21, oo = 1 << 29;
char gR[N][N];
char gC[N][N];
int dfs_num[N * N];
int dfs_low[N * N];
int dfs_cnt;
bool vis[N * N];
vector<int> g[N * N];
int scc;
vector<int> s;
int r, c;
char ch;
void SCC(int u) {
  dfs_num[u] = dfs_low[u] = dfs_cnt++;
  vis[u] = true;
  s.push_back(u);
  for (int i = 0; i < (int)g[u].size(); ++i) {
    int v = g[u][i];
    if (dfs_num[v] == -1) SCC(v);
    if (vis[v]) dfs_low[u] = min(dfs_low[u], dfs_low[v]);
  }
  if (dfs_low[u] == dfs_num[u]) {
    ++scc;
    while (1) {
      int x = s.back();
      s.pop_back();
      vis[x] = false;
      if (x == u) break;
    }
  }
}
bool check(int i, int j) { return (i < 0 || j < 0 || i >= r || j >= c); }
int main() {
  cin >> r >> c;
  for (int i = 0; i < r; ++i) {
    cin >> ch;
    for (int j = 0; j < c; ++j) gR[i][j] = ch;
  }
  for (int i = 0; i < c; ++i) {
    cin >> ch;
    for (int j = 0; j < r; ++j) gC[j][i] = ch;
  }
  for (int i = 0; i < r; ++i) {
    for (int j = 0; j < c; ++j) {
      if (gR[i][j] == '<') {
        int nr = i;
        int nc = j - 1;
        if (!check(nr, nc)) g[i * c + j].push_back(nr * c + nc);
      } else {
        int nr = i;
        int nc = j + 1;
        if (!check(nr, nc)) g[i * c + j].push_back(nr * c + nc);
      }
      if (gC[i][j] == '^') {
        int nr = i - 1;
        int nc = j;
        if (!check(nr, nc)) g[i * c + j].push_back(nr * c + nc);
      } else {
        int nr = i + 1;
        int nc = j;
        if (!check(nr, nc)) g[i * c + j].push_back(nr * c + nc);
      }
    }
  }
  for (int i = 0; i < r * c; ++i) dfs_num[i] = dfs_low[i] = -1;
  for (int i = 0; i < r * c; ++i)
    if (dfs_num[i] == -1) SCC(i);
  if (scc == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
