#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  string sn, sm;
  cin >> sn;
  cin >> sm;
  int t = 1;
  int p, q;
  int a[21][21];
  vector<int> x;
  vector<int> y;
  for (int i = 0, _n = n; i < _n; i++)
    for (int j = 0, _n = m; j < _n; j++) {
      memset(a, 0, sizeof a);
      a[i][j] = 1;
      p = -1;
      q = 0;
      x.push_back(i);
      y.push_back(j);
      while (p < q) {
        p++;
        if (sn[x[p]] == '<' && y[p] > 0 && a[x[p]][y[p] - 1] == 0) {
          q++;
          x.push_back(x[p]);
          y.push_back(y[p] - 1);
          a[x[q]][y[q]] = 1;
        }
        if (sn[x[p]] == '>' && y[p] < m - 1 && a[x[p]][y[p] + 1] == 0) {
          q++;
          x.push_back(x[p]);
          y.push_back(y[p] + 1);
          a[x[q]][y[q]] = 1;
        }
        if (sm[y[p]] == '^' && x[p] > 0 && a[x[p] - 1][y[p]] == 0) {
          q++;
          x.push_back(x[p] - 1);
          y.push_back(y[p]);
          a[x[q]][y[q]] = 1;
        }
        if (sm[y[p]] == 'v' && x[p] < n - 1 && a[x[p] + 1][y[p]] == 0) {
          q++;
          x.push_back(x[p] + 1);
          y.push_back(y[p]);
          a[x[q]][y[q]] = 1;
        }
      }
      if (q != n * m - 1) {
        t = 0;
        break;
      }
      x.clear();
      y.clear();
    }
  if (t)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
