#include <bits/stdc++.h>
using namespace std;
int getint() {
  int ans = 0, f = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + c - '0';
    c = getchar();
  }
  return ans * f;
}
int f[10010];
int _(int x) { return x == f[x] ? x : f[x] = _(f[x]); }
struct bian {
  int e, n;
};
bian b[2000010];
int s[10010], tot = 0;
void add(int x, int y) {
  tot++;
  b[tot].e = y;
  b[tot].n = s[x];
  s[x] = tot;
}
int p[10010], in[10010], cnt = 0;
int n;
bool topo() {
  for (int i = 1; i <= n; i++) {
    for (int j = s[i]; j; j = b[j].n) {
      in[b[j].e]++;
    }
  }
  queue<int> q;
  for (int i = 1; i <= n; i++)
    if (!in[i]) q.push(i), p[i] = 1;
  while (q.size()) {
    int f = q.front();
    q.pop();
    ++cnt;
    for (int i = s[f]; i; i = b[i].n) {
      in[b[i].e]--;
      if (!in[b[i].e]) q.push(b[i].e), p[b[i].e] = p[f] + 1;
    }
  }
  return cnt == n;
}
char c[1010][1010];
int main() {
  int x = getint(), y = getint();
  n = x + y;
  for (int i = 1; i <= x + y; i++) f[i] = i;
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < y; j++) {
      c[i][j] = getchar();
      while (c[i][j] != '<' && c[i][j] != '>' && c[i][j] != '=')
        c[i][j] = getchar();
      if (c[i][j] == '=') f[_(i + 1)] = f[_(x + j + 1)];
    }
  }
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < y; j++) {
      if (c[i][j] == '<') add(_(i + 1), _(x + j + 1));
      if (c[i][j] == '>') add(_(x + j + 1), _(i + 1));
    }
  }
  if (!topo())
    return puts("No"), 0;
  else
    puts("Yes");
  for (int i = 0; i < x; i++) cout << p[_(i + 1)] << " ";
  cout << endl;
  for (int i = 0; i < y; i++) cout << p[_(x + i + 1)] << " ";
  cout << endl;
  return 0;
}
