#include <bits/stdc++.h>
using namespace std;
const int N = 2000010, mod = 1e9 + 7;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int n, m, fa[N];
char g[1010][1010];
int Find(int x) { return fa[x] == x ? x : fa[x] = Find(fa[x]); }
int h[N], ne[N], e[N], idx, d[N], ans[N], q[N], vis[N];
void add(int a, int b) { d[b]++, e[idx] = b, ne[idx] = h[a], h[a] = idx++; }
int main() {
  memset(h, -1, sizeof h);
  n = read(), m = read();
  for (int i = 1; i <= n; ++i) scanf("%s", g[i] + 1);
  for (int i = 1; i <= n + m; ++i) fa[i] = i;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      int x = Find(i), y = Find(n + j);
      if (g[i][j] == '=' && x != y) fa[x] = y;
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      int x = Find(i), y = Find(n + j);
      if (x == y && g[i][j] != '=') {
        puts("No");
        return 0;
      } else if (g[i][j] == '>')
        add(y, x);
      else if (g[i][j] == '<')
        add(x, y);
    }
  }
  int hh = 0, tt = 0;
  for (int i = 1; i <= n + m; ++i) {
    if (d[Find(i)] == 0 && vis[Find(i)] == 0)
      q[tt++] = Find(i), ans[Find(i)] = 1, vis[Find(i)] = 1;
  }
  while (hh != tt) {
    int u = q[hh++];
    for (int i = h[u]; ~i; i = ne[i]) {
      int t = Find(e[i]);
      ans[t] = max(ans[t], ans[u] + 1);
      if (--d[t] == 0) q[tt++] = t, vis[t] = 1;
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (!vis[Find(i)]) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  for (int i = 1; i <= n; ++i) {
    cout << ans[Find(i)] << ' ';
  }
  puts("");
  for (int i = 1; i <= m; ++i) {
    cout << ans[Find(i + n)] << ' ';
  }
  return 0;
}
