#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int INF = INT_MAX;
const long double pi = 4 * atan((long double)1);
vector<int> AdjList[2005];
int ran[2005];
int parent[2005], siz[2005], up[2005];
bool check;
int visited[2005];
bool les[2005], pass[2005];
void make_set(int v) {
  parent[v] = v;
  siz[v] = 1;
}
int find_set(int v) {
  if (parent[v] == v) return v;
  return parent[v] = find_set(parent[v]);
}
void union_set(int a, int b) {
  a = find_set(a), b = find_set(b);
  if (a == b) return;
  if (siz[a] < siz[b]) swap(a, b);
  parent[b] = a;
  siz[a] += siz[b];
}
void dfs(int start, int rk) {
  ran[start] = rk;
  visited[start] = 1;
  if (check) return;
  for (int i = 0; i < AdjList[start].size(); i++) {
    int u = AdjList[start][i];
    if (visited[u] == 1) {
      check = true;
      return;
    }
    if (visited[u] == 2) {
      if (ran[u] < rk + 1)
        dfs(u, rk + 1);
      else if (ran[u] > rk + 1)
        continue;
    } else
      dfs(u, rk + 1);
  }
  visited[start] = 2;
}
signed main() {
  ios::sync_with_stdio();
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n + m; i++) make_set(i);
  string str[n + 2];
  for (int i = 1; i <= n; i++) {
    cin >> str[i];
    for (int j = 0; j < str[i].length(); j++) {
      if (str[i][j] == '=') {
        union_set(i, j + 1 + n);
      }
    }
  }
  for (int i = 1; i <= n + m; i++) parent[i] = find_set(i);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < str[i].length(); j++) {
      if (str[i][j] == '>') {
        if (parent[j + 1 + n] == parent[i]) {
          cout << "No";
          return 0;
        }
        AdjList[parent[j + 1 + n]].push_back(parent[i]);
        les[parent[i]] = true;
      }
      if (str[i][j] == '<') {
        if (parent[j + 1 + n] == parent[i]) {
          cout << "No";
          return 0;
        }
        AdjList[parent[i]].push_back(parent[j + 1 + n]);
        les[parent[j + 1 + n]] = true;
      }
    }
  }
  for (int i = 1; i <= n + m; i++) {
    if (!les[parent[i]]) {
      dfs(parent[i], 1);
    }
    if (check) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (int i = 1; i <= n; i++) cout << ran[parent[i]] << " ";
  cout << endl;
  for (int i = n + 1; i <= n + m; i++) cout << ran[parent[i]] << " ";
}
