#include <bits/stdc++.h>
using namespace std;
namespace atcoder {
struct dsu {
 public:
  dsu() : _n(0) {}
  dsu(int n) : _n(n), parent_or_size(n, -1) {}
  int merge(int a, int b) {
    assert(0 <= a && a < _n);
    assert(0 <= b && b < _n);
    int x = leader(a), y = leader(b);
    if (x == y) return x;
    if (-parent_or_size[x] < -parent_or_size[y]) std::swap(x, y);
    parent_or_size[x] += parent_or_size[y];
    parent_or_size[y] = x;
    return x;
  }
  bool same(int a, int b) {
    assert(0 <= a && a < _n);
    assert(0 <= b && b < _n);
    return leader(a) == leader(b);
  }
  int leader(int a) {
    assert(0 <= a && a < _n);
    if (parent_or_size[a] < 0) return a;
    return parent_or_size[a] = leader(parent_or_size[a]);
  }
  int size(int a) {
    assert(0 <= a && a < _n);
    return -parent_or_size[leader(a)];
  }
  std::vector<std::vector<int>> groups() {
    std::vector<int> leader_buf(_n), group_size(_n);
    for (int i = 0; i < _n; i++) {
      leader_buf[i] = leader(i);
      group_size[leader_buf[i]]++;
    }
    std::vector<std::vector<int>> result(_n);
    for (int i = 0; i < _n; i++) {
      result[i].reserve(group_size[i]);
    }
    for (int i = 0; i < _n; i++) {
      result[leader_buf[i]].push_back(i);
    }
    result.erase(
        std::remove_if(result.begin(), result.end(),
                       [&](const std::vector<int>& v) { return v.empty(); }),
        result.end());
    return result;
  }

 private:
  int _n;
  std::vector<int> parent_or_size;
};
}  // namespace atcoder
const int MAXN = 2010;
string s[MAXN];
bool z[MAXN][MAXN];
int in[MAXN];
int ans[MAXN];
bool cz[MAXN];
int h[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> s[i];
  atcoder::dsu dsu(n + m);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (s[i][j] == '=') dsu.merge(i, n + j);
    }
  }
  bool flag = true;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (s[i][j] == '=') continue;
      if (dsu.same(i, n + j)) flag = false;
    }
  }
  if (!flag) {
    cout << "No\n";
    return 0;
  }
  vector<int> leaders;
  for (int i = 0; i < n + m; ++i) {
    leaders.push_back(dsu.leader(i));
  }
  sort(leaders.begin(), leaders.end());
  leaders.erase(unique(leaders.begin(), leaders.end()), leaders.end());
  int nm = leaders.size();
  for (int i = 0; i < nm; ++i) h[leaders[i]] = i;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (s[i][j] == '=') continue;
      int a = dsu.leader(i), b = dsu.leader(n + j);
      if (s[i][j] == '<') {
        z[h[a]][h[b]] = true;
      } else {
        z[h[b]][h[a]] = true;
      }
    }
  }
  for (int i = 0; i < nm; ++i) {
    for (int j = 0; j < nm; ++j) {
      if (z[i][j]) ++in[j];
    }
  }
  queue<int> Q;
  for (int i = 0; i < nm; ++i) {
    if (in[i] == 0) {
      Q.push(i);
      cz[i] = true;
      ans[i] = 1;
    }
  }
  while (!Q.empty()) {
    int a = Q.front();
    Q.pop();
    for (int i = 0; i < nm; ++i) {
      if (z[a][i]) {
        --in[i];
        ans[i] = max(ans[i], ans[a] + 1);
        if (in[i] == 0) {
          Q.push(i);
          cz[i] = true;
        }
      }
    }
  }
  int cnt = 0;
  for (int i = 0; i < nm; ++i) {
    if (cz[i]) ++cnt;
  }
  if (cnt != leaders.size()) {
    cout << "No\n";
    return 0;
  }
  cout << "YES\n";
  for (int i = 0; i < n; ++i) {
    cout << ans[h[dsu.leader(i)]] << " ";
  }
  cout << '\n';
  for (int i = 0; i < m; ++i) {
    cout << ans[h[dsu.leader(n + i)]] << " ";
  }
  cout << '\n';
  return 0;
}
