#include <bits/stdc++.h>
using namespace std;
vector<int> v[3005];
int r[3005];
int f(int a) {
  if (r[a] == a)
    return a;
  else
    return r[a] = f(r[a]);
}
void u(int a, int b) {
  a = f(a);
  b = f(b);
  if (a == b) return;
  r[a] = b;
}
vector<int> o[3005], in[3005];
vector<int> top;
int st[3005];
bool ff;
void dfs(int node) {
  if (st[node] == 1) {
    ff = true;
    return;
  }
  if (st[node] == 2) return;
  st[node] = 1;
  for (auto u : o[node]) {
    dfs(u);
  }
  top.push_back(node);
  st[node] = 2;
  return;
}
int ans[3005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cout.tie(0);
  long long n, m;
  memset(st, 0, sizeof st);
  memset(ans, -1, sizeof ans);
  cin >> n >> m;
  for (int i = 1; i <= n + m; i++) {
    r[i] = i;
  }
  string s[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    int p = n + 1;
    for (auto x : s[i]) {
      int a = f(i), b = f(p);
      if (x == '=') {
        u(a, b);
      }
      p++;
    }
  }
  for (int i = 1; i <= n; i++) {
    int p = n + 1;
    for (auto x : s[i]) {
      int a = f(i), b = f(p);
      if (x == '=') {
      } else if (x == '<') {
        int a = f(i), b = f(p);
        if (a == b) {
          ff = true;
        }
        o[a].push_back(b);
        in[b].push_back(a);
      } else {
        int a = f(i), b = f(p);
        if (a == b) {
          ff = true;
        }
        swap(a, b);
        o[a].push_back(b);
        in[b].push_back(a);
      }
      p++;
    }
  }
  for (int i = 1; i <= n + m; i++) {
    if (f(i) == i && st[i] == 0) {
      dfs(i);
    }
  }
  if (ff) {
    cout << "No";
    return 0;
  }
  cout << "Yes\n";
  reverse(top.begin(), top.end());
  for (int u : top) {
    int mx = 0;
    for (auto x : in[u]) {
      if (ans[x] != -1) {
        mx = max(ans[x], mx);
      }
    }
    ans[u] = mx + 1;
  }
  for (int i = 1; i <= n + m; i++) {
    cout << ans[f(i)] << ' ';
    if (i == n) cout << '\n';
  }
}
