#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T lowbit(T x) {
  return x & (-x);
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
inline T Pow(T a, T b, T p) {
  T ret = 1;
  a %= p;
  for (; b; b >>= 1, a = a * a % p)
    if (b & 1) (ret *= a) %= p;
  return ret;
}
template <class T>
inline void read(T &ret) {
  T 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 * 10 + ch - '0';
    ch = getchar();
  }
  ret = x * f;
}
const int N = 2010, M = 1e6 + 10;
struct dsu {
  int par[N];
  void init(int n) {
    for (int i = (1); i <= (n); i++) par[i] = i;
  }
  int find(int u) { return par[u] == u ? u : par[u] = find(par[u]); }
  void join(int u, int v) {
    u = find(u);
    v = find(v);
    if (u == v) return;
    par[u] = v;
  }
} s;
struct edge {
  int v, nxt;
} g[M];
int head[N], sz = 0;
void add(int u, int v) {
  g[++sz] = {v, head[u]};
  head[u] = sz;
}
int n, m, deg[N];
char mat[N][N];
bool flg[N], edg[N][N];
int d[N], q[N];
bool bfs() {
  int h = 0, t = 0;
  for (int i = (1); i <= (n + m); i++)
    if (flg[i]) q[t++] = i, d[i] = 1;
  for (; h != t; h++) {
    int u = q[h];
    for (int i = head[u], v; i; i = g[i].nxt) {
      deg[v = g[i].v]--;
      if (!deg[v]) {
        q[t++] = v;
        d[v] = d[u] + 1;
      }
    }
  }
  for (int i = (1); i <= (n + m); i++)
    if (deg[i]) return false;
  return true;
}
int main() {
  read(n);
  read(m);
  s.init(n + m);
  for (int i = (1); i <= (n); i++) {
    scanf("%s", mat[i]);
    for (int j = (0); j <= (m - 1); j++)
      if (mat[i][j] == '=') s.join(i, j + n + 1);
  }
  for (int i = (1); i <= (n); i++)
    for (int j = (0); j <= (m - 1); j++)
      if (mat[i][j] == '<') {
        int u = s.find(i), v = s.find(j + n + 1);
        if (!edg[u][v]) add(u, v), deg[v]++;
        edg[u][v] = 1;
      } else if (mat[i][j] == '>') {
        int u = s.find(j + 1 + n), v = s.find(i);
        if (!edg[u][v]) add(u, v), deg[v]++;
        edg[u][v] = 1;
      }
  for (int i = (1); i <= (n + m); i++)
    if (!deg[s.find(i)]) flg[s.find(i)] = 1;
  if (bfs()) {
    printf("YES\n");
    for (int i = (1); i <= (n); i++) printf("%d ", d[s.find(i)]);
    printf("\n");
    for (int i = (1); i <= (m); i++) printf("%d ", d[s.find(i + n)]);
  } else
    printf("NO");
}
