#include <bits/stdc++.h>
using namespace std;
const int maxn = 4000 + 10;
const int MAXN = 2000000 + 10;
const int inf = 0x3f3f3f3f;
struct Edge {
  int from;
  int to;
  int next;
} edge[MAXN];
int n, m, e, cnt, head[maxn], in[maxn], val[maxn], vis[maxn][maxn];
int pre[maxn], rnk[maxn];
char mp[maxn][maxn];
void add_edge(int u, int v) {
  edge[e].from = u;
  edge[e].to = v;
  edge[e].next = head[u];
  head[u] = e++;
}
int find(int x) { return x == pre[x] ? x : pre[x] = find(pre[x]); }
void join(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y) return;
  if (rnk[x] > rnk[y])
    pre[y] = x;
  else {
    if (rnk[x] == rnk[y]) rnk[x]++;
    pre[x] = y;
  }
}
bool solve() {
  queue<int> q;
  for (int i = 1; i <= n + m; i++)
    if (i == pre[i] && in[i] == 0) {
      q.push(i);
      val[i] = 1;
    }
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = head[u]; i != -1; i = edge[i].next) {
      int v = edge[i].to;
      val[v] = max(val[v], val[u] + 1);
      if (--in[v] == 0) q.push(v);
    }
  }
  for (int i = 1; i <= n + m; i++)
    if (i == pre[i] && in[i] > 0) return false;
  return true;
}
void init() {
  for (int i = 0; i < maxn; i++) {
    pre[i] = i;
    head[i] = -1;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (mp[i][j] == '=') join(i, n + j);
  for (int i = 1; i <= n + m; i++)
    if (i == find(i)) cnt++;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (mp[i][j] == '<' && !vis[pre[i]][pre[n + j]]) {
        add_edge(pre[i], pre[n + j]);
        in[pre[n + j]]++;
        vis[pre[i]][pre[n + j]] = 1;
      } else if (mp[i][j] == '>' && !vis[pre[n + j]][pre[i]]) {
        add_edge(pre[n + j], pre[i]);
        in[pre[i]]++;
        vis[pre[n + j]][pre[i]] = 1;
      }
    }
}
int main() {
  scanf("%d%d", &n, &m);
  getchar();
  for (int i = 1; i <= n; i++) gets(mp[i] + 1);
  init();
  if (solve() == false) {
    printf("No\n");
    return 0;
  }
  printf("Yes\n");
  for (int i = 1; i <= n; i++) printf("%d ", val[pre[i]]);
  putchar('\n');
  for (int i = 1; i <= m; i++) printf("%d ", val[pre[n + i]]);
  putchar('\n');
}
