#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5, mod = 998244353;
template <class o>
inline void qr(o &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + (c ^ 48);
    c = getchar();
  }
  x *= f;
}
template <class o>
void qw(o x) {
  if (x / 10) qw(x / 10);
  putchar(x % 10 + 48);
}
template <class o>
void pr1(o x) {
  if (x < 0) putchar('-'), x = -x;
  qw(x);
  putchar(' ');
}
template <class o>
void pr2(o x) {
  if (x < 0) putchar('-'), x = -x;
  qw(x);
  puts("");
}
inline int ksm(int a, int b = mod - 2) {
  int ans = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) ans = 1ll * ans * a % mod;
  return ans;
}
inline int add(int a, int b) { return a += b, a >= mod ? a - mod : a; }
inline int sub(int a, int b) { return a -= b, a < 0 ? a + mod : a; }
int fa[N], d[N], edg[N][N], q[N], ans[N];
char s[N][N];
int get(int x) { return x == fa[x] ? x : fa[x] = get(fa[x]); }
void solve() {
  int n, m;
  qr(n), qr(m);
  for (int i = 1; i <= n; ++i) scanf("%s", s[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)
      if (s[i][j] == '=') fa[get(j + n)] = get(i);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if (s[i][j] != '=') {
        int x = get(i), y = get(j + n);
        if (x == y) {
          puts("No");
          return;
        }
        if (s[i][j] == '>') {
          if (!edg[y][x]) edg[y][x] = 1, ++d[x];
        } else if (!edg[x][y])
          edg[x][y] = 1, ++d[y];
      }
  int l = 1, r = 0;
  for (int i = 1; i <= n + m; ++i)
    if (!d[i] && i == get(i)) q[++r] = i, ans[i] = 1;
  for (int x = q[l]; l <= r; x = q[++l]) {
    for (int y = 1; y <= n + m; ++y)
      if (edg[x][y]) {
        --edg[x][y];
        --d[y];
        ans[y] = max(ans[y], ans[x] + 1);
        if (!d[y]) q[++r] = y;
      }
  }
  for (int i = 1; i <= n + m; ++i)
    if (d[i]) {
      puts("No");
      return;
    }
  puts("Yes");
  for (int i = 1; i <= n + m; ++i) ans[i] = ans[get(i)];
  for (int i = 1; i <= n; ++i) pr1(ans[i]);
  puts("");
  for (int i = 1; i <= m; ++i) pr1(ans[i + n]);
}
int main() {
  solve();
  return 0;
}
