#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e14;
const long long TE3 = 1005;
const long long TE5 = 100005;
int n, m;
char ch;
int u[405];
int g(int i, int j) { return ((i - 1) * m + j); }
int ans = 1;
bool all1s() {
  int l = m * n + 1;
  for (int i = (1); i < (l); ++i) {
    if (!u[i]) return false;
  }
  return true;
}
void set_u() {
  for (int i = (0); i < (405); ++i) u[i] = 0;
}
void dfs(vector<vector<int> >& adj, int x) {
  u[x] = 1;
  int y;
  for (int i = (0); i < (adj[x].size()); ++i) {
    y = adj[x][i];
    if (!u[y]) dfs(adj, y);
  }
}
int main() {
  cin >> n >> m;
  int x, y;
  vector<vector<int> > adj(405);
  for (int i = (1); i < (n + 1); ++i) {
    cin >> ch;
    for (int j = (1); j < (m); ++j) {
      x = g(i, j);
      y = g(i, j + 1);
      if (ch == '>')
        adj[x].push_back(y);
      else
        adj[y].push_back(x);
    }
  }
  for (int i = (1); i < (m + 1); ++i) {
    cin >> ch;
    for (int j = (1); j < (n); ++j) {
      x = g(j, i);
      y = g(j + 1, i);
      if (ch == 'v')
        adj[x].push_back(y);
      else
        adj[y].push_back(x);
    }
  }
  int gg;
  for (int i = (1); i < (n + 1); ++i) {
    for (int j = (1); j < (m + 1); ++j) {
      x = g(i, j);
      set_u();
      dfs(adj, x);
      if (!all1s()) {
        cout << "NO\n";
        return 0;
      }
    }
  }
  cout << "YES\n";
  return 0;
}
