#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<vector<int> > graph;
vector<vector<int> > newg;
vector<bool> visited;
stack<int> ss;
void transpose() {
  newg.resize(n * m);
  for (__typeof(n * m) i = (0) - ((0) > (n * m));
       i != (n * m) - ((0) > (n * m)); i += 1 - 2 * ((0) > (n * m))) {
    for (auto it = graph[i].begin(); it != graph[i].end(); it++)
      newg[*it].push_back(i);
  }
}
void dfs(int s) {
  visited[s] = true;
  for (auto it = graph[s].begin(); it != graph[s].end(); it++) {
    if (!visited[*it]) {
      dfs(*it);
    }
  }
  ss.push(s);
}
void dfs_stack_popping(int s) {
  visited[s] = true;
  for (auto it = newg[s].begin(); it != newg[s].end(); it++) {
    if (!visited[*it]) {
      dfs_stack_popping(*it);
    }
  }
  if (!ss.empty()) ss.pop();
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  char c;
  graph.resize(n * m);
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    int base = i * m;
    cin >> c;
    if (c == '<') {
      int start = base + (m - 1);
      for (__typeof(base + 1) j = (start + 1) - ((start + 1) > (base + 1));
           j != (base + 1) - ((start + 1) > (base + 1));
           j += 1 - 2 * ((start + 1) > (base + 1))) {
        graph[j].push_back(j - 1);
      }
    } else {
      int start = base;
      for (__typeof(base + m - 1) j = (start) - ((start) > (base + m - 1));
           j != (base + m - 1) - ((start) > (base + m - 1));
           j += 1 - 2 * ((start) > (base + m - 1))) {
        graph[j].push_back(j + 1);
      }
    }
  }
  for (__typeof(m) i = (0) - ((0) > (m)); i != (m) - ((0) > (m));
       i += 1 - 2 * ((0) > (m))) {
    int gap = m;
    cin >> c;
    int start = i;
    if (c == '^') {
      start += (gap) * (n - 1);
      for (int j = start; j > i; j = j - gap) {
        graph[j].push_back(j - gap);
      }
    } else {
      start = i;
      for (int j = start; j < gap * (n - 1); j = j + gap) {
        graph[j].push_back(j + gap);
      }
    }
  }
  visited.resize(m * n, false);
  for (__typeof(n * m) i = (0) - ((0) > (n * m));
       i != (n * m) - ((0) > (n * m)); i += 1 - 2 * ((0) > (n * m))) {
    if (!visited[i]) dfs(i);
  }
  transpose();
  visited.clear();
  visited.resize(m * n, false);
  int component = 0;
  while (!ss.empty()) {
    int t = ss.top();
    component++;
    dfs_stack_popping(t);
  }
  if (component == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
