#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 2e3 + 69, MOD = 1e9 + 7;
char arr[MAXN][MAXN];
long long n, m, mark[MAXN], par[MAXN], sz[MAXN], ans[MAXN];
vector<long long> topol, g[MAXN], rev[MAXN];
long long find(long long v) {
  if (par[v] == 0) return v;
  return par[v] = find(par[v]);
}
void merge(long long v, long long u) {
  v = find(v), u = find(u);
  if (v == u) return;
  if (sz[v] < sz[u]) swap(v, u);
  par[u] = v, sz[v] += sz[u];
}
void dfs(long long v) {
  mark[v] = 1;
  for (auto u : g[v])
    if (!mark[u]) dfs(u);
  topol.push_back(v);
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (long long i = 1; i < MAXN; i++) sz[i] = 1;
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) {
      cin >> arr[i][j];
      if (arr[i][j] == '=') merge(find(i), find(n + j));
    }
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) {
      if (arr[i][j] == '<') {
        g[find(i)].push_back(find(n + j));
        rev[find(n + j)].push_back(find(i));
      }
      if (arr[i][j] == '>') {
        g[find(n + j)].push_back(find(i));
        rev[find(i)].push_back(find(n + j));
      }
    }
  for (long long i = 1; i <= n + m; i++)
    if (!mark[find(i)]) dfs(i);
  memset(mark, 0, sizeof mark);
  reverse(topol.begin(), topol.end());
  for (long long i = 0; i < (long long)topol.size(); i++) {
    if (rev[topol[i]].size() == 0) {
      ans[topol[i]] = 1;
      continue;
    }
    for (auto u : rev[topol[i]]) ans[topol[i]] = max(ans[topol[i]], ans[u] + 1);
  }
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= n; j++)
      if ((arr[i][j] == '<' and ans[find(i)] >= ans[find(n + j)]) or
          (arr[i][j] == '=' and ans[find(i)] != ans[find(n + j)]) or
          (arr[i][j] == '>' and ans[find(i)] <= ans[find(n + j)]))
        return cout << "No\n", 0;
  cout << "Yes\n";
  for (long long i = 1; i <= n; i++) cout << ans[find(i)] << " ";
  cout << "\n";
  for (long long i = n + 1; i <= n + m; i++) cout << ans[find(i)] << " ";
  cout << "\n";
}
