#include <bits/stdc++.h>
using namespace std;
int DFS(int s, int m, int n, bool a[][500]) {
  stack<int> dinh;
  int u, v;
  dinh.push(s);
  bool Free[500 * 500];
  memset(Free, true, sizeof(Free));
  int dem = 0;
  do {
    u = dinh.top();
    dinh.pop();
    for (int v = 1; v <= m * n; v++)
      if ((Free[v] == true) && (a[u][v] == true)) {
        Free[v] = false;
        dem++;
        dinh.push(u);
        dinh.push(v);
        break;
      }
  } while (!dinh.empty());
  return dem;
}
int main() {
  bool a[500][500];
  memset(a, false, sizeof(a));
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m * n; i++) a[i][i] = true;
  char d[500];
  char c[500];
  int o = 1;
  int i = 1;
  for (i = 1; i <= n; i++) {
    cin >> d[i];
    if (d[i] == '>') {
      for (int j = o; j <= m - 2 + o; j++) {
        a[j][j + 1] = true;
      }
      o = i * m + 1;
    } else {
      for (int j = o; j <= m - 2 + o; j++) {
        a[j + 1][j] = true;
      }
      o = i * m + 1;
    }
  }
  o = 1;
  for (i = 1; i <= m; i++) {
    cin >> c[i];
    if (c[i] == 'v') {
      for (int j = 1; j <= n; j++) {
        a[o][o + m] = true;
        o += m;
      }
    } else {
      for (int j = 1; j <= n; j++) {
        a[o + m][o] = true;
        o += m;
      }
    }
    o = i + 1;
  }
  int ans = 0;
  for (int k = 1; k <= m * n; k++) {
    if (DFS(k, m, n, a) == m * n)
      ans++;
    else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
