#include <bits/stdc++.h>
using namespace std;
int n, m;
pair<int, int> path[20][20];
bool marked[20][20];
int counter = 0;
inline void dfs(int x, int y) {
  if (x >= n || y >= m) return;
  if (marked[x][y]) return;
  counter++;
  marked[x][y] = true;
  if (path[x][y].first == 3) dfs(x, y + 1);
  if (path[x][y].first == 4) dfs(x, y - 1);
  if (path[x][y].second == 1) dfs(x - 1, y);
  if (path[x][y].second == 2) dfs(x + 1, y);
}
int main() {
  char dir;
  memset(path, 0, sizeof(path));
  memset(marked, 0, sizeof(marked));
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> dir;
    if (dir == '>')
      for (int j = 0; j < m - 1; j++) path[i][j].first = 3;
    else
      for (int j = 1; j < m; j++) path[i][j].first = 4;
  }
  for (int i = 0; i < m; i++) {
    cin >> dir;
    if (dir == 'v')
      for (int j = 0; j < n - 1; j++) path[j][i].second = 2;
    else
      for (int j = 1; j < n; j++) path[j][i].second = 1;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      dfs(i, j);
      if (counter != n * m) {
        cout << "NO\n";
        return 0;
      }
      counter = 0;
      memset(marked, 0, sizeof(marked));
    }
  cout << "YES\n";
  return 0;
}
