Problem: Mr. Apple, a gourmet, works as editor-in-chief of a gastronomic periodical. He travels around the world, tasting new delights of famous chefs from the most fashionable restaurants. Mr. Apple has his own signature method of review — in each restaurant Mr. Apple orders two sets of dishes on two different days. All the dishes are different, because Mr. Apple doesn't like to eat the same food. For each pair of dishes from different days he remembers exactly which was better, or that they were of the same quality. After this the gourmet evaluates each dish with a positive integer.

Once, during a revision of a restaurant of Celtic medieval cuisine named «Poisson», that serves chestnut soup with fir, warm soda bread, spicy lemon pie and other folk food, Mr. Apple was very pleasantly surprised the gourmet with its variety of menu, and hence ordered too much. Now he's confused about evaluating dishes.

The gourmet tasted a set of n dishes on the first day and a set of m dishes on the second day. He made a table a of size n × m, in which he described his impressions. If, according to the expert, dish i from the first set was better than dish j from the second set, then a_{ij} is equal to ">", in the opposite case a_{ij} is equal to "<". Dishes also may be equally good, in this case a_{ij} is "=".

Now Mr. Apple wants you to help him to evaluate every dish. Since Mr. Apple is very strict, he will evaluate the dishes so that the maximal number used is as small as possible. But Mr. Apple also is very fair, so he never evaluates the dishes so that it goes against his feelings. In other words, if a_{ij} is "<", then the number assigned to dish i from the first set should be less than the number of dish j from the second set, if a_{ij} is ">", then it should be greater, and finally if a_{ij} is "=", then the numbers should be the same.

Help Mr. Apple to evaluate each dish from both sets so that it is consistent with his feelings, or determine that this is impossible.

Input

The first line contains integers n and m (1 ≤ n, m ≤ 1000) — the number of dishes in both days.

Each of the next n lines contains a string of m symbols. The j-th symbol on i-th line is a_{ij}. All strings consist only of "<", ">" and "=".

Output

The first line of output should contain "Yes", if it's possible to do a correct evaluation for all the dishes, or "No" otherwise.

If case an answer exist, on the second line print n integers — evaluations of dishes from the first set, and on the third line print m integers — evaluations of dishes from the second set.

Examples

Input


3 4
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;


Output


Yes
2 2 2 
1 1 1 1 


Input


3 3
&gt;&gt;&gt;
&lt;&lt;&lt;
&gt;&gt;&gt;


Output


Yes
3 1 3 
2 2 2 


Input


3 2
==
=&lt;
==


Output


No

Note

In the first sample, all dishes of the first day are better than dishes of the second day. So, the highest score will be 2, for all dishes of the first day.

In the third sample, the table is contradictory — there is no possible evaluation of the dishes that satisfies it.

Solution (in JAVA):

Solution:
import java.util.*;
import java.io.*;
 
public class Main {
    static FastScanner sc = new FastScanner(System.in);
    static PrintWriter pw = new PrintWriter(System.out);
    static StringBuilder sb = new StringBuilder();
    static ArrayList<ArrayList<Integer>> G;
    static int[] indegree;
    static int V,E;
    static int[] ans;
    static boolean flg = true;
    static DSU dsu;
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        int m = sc.nextInt();
        dsu = new DSU(n+m);
        char[][] map = new char[n][m];
        for(int i = 0; i < n; i++) map[i] = sc.next().toCharArray();
        V = n+m;
        E = n*m;
        G = new ArrayList<>();
        for(int i = 0; i < V; i++){
            G.add(new ArrayList<>());
        }
        indegree = new int[V];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                if(map[i][j] == '='){
                    dsu.merge(i,n+j);
                }
            }
        }
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                if(map[i][j] == '<'){
                    int u = dsu.leader(i);
                    int v = dsu.leader(n+j);
                    G.get(u).add(v);
                    indegree[v]++;
                }else if(map[i][j] == '>'){
                    int u = dsu.leader(n+j);
                    int v = dsu.leader(i);
                    G.get(u).add(v);
                    indegree[v]++;
                }
            }
        }
        ans = new int[n+m];
        Arrays.fill(ans,Integer.MAX_VALUE);
        ArrayList<Integer> sortedV = topologicalSort();
        if(sortedV.size() != n+m){
            pw.println("No");
        }else{
            pw.println("Yes");
            for(int i = 0; i < n; i++){
                sb.append(ans[dsu.leader(i)]).append(" ");
            }
            pw.println(sb.toString().trim());
            sb.setLength(0);
            for(int i = n; i < n+m; i++){
                sb.append(ans[dsu.leader(i)]).append(" ");
            }
            pw.println(sb.toString().trim());
        }
        pw.flush();
    }
    
    public static ArrayList<Integer> topologicalSort(){
        ArrayList<Integer> sorted_vertices = new ArrayList<>();
        Deque<Item> q = new ArrayDeque<>();
        for(int i = 0; i < V; i++){
            if(indegree[i] == 0){
                q.push(new Item(i,1));
            }
        }
        while (q.size() > 0) {
            Item item = q.pop();
            int v = item.i;
            int w = item.w;
            ans[v] = Math.min(ans[v],w);
            for(int u : G.get(v)){
                indegree[u]--;
                if(indegree[u] == 0){
                    q.push(new Item(u,w+1));
                }
            }
            sorted_vertices.add(v);
        }
        return sorted_vertices;
    }
    
    static class Item{
        int i,w;
        public Item(int i, int w){
            this.i = i;
            this.w = w;
        }
    }

    static class GeekInteger {
        public static void save_sort(int[] array) {
            shuffle(array);
            Arrays.sort(array);
        }
 
        public static int[] shuffle(int[] array) {
            int n = array.length;
            Random random = new Random();
            for (int i = 0, j; i < n; i++) {
                j = i + random.nextInt(n - i);
                int randomElement = array[j];
                array[j] = array[i];
                array[i] = randomElement;
            }
            return array;
        }
        
        public static void save_sort(long[] array) {
            shuffle(array);
            Arrays.sort(array);
        }
 
        public static long[] shuffle(long[] array) {
            int n = array.length;
            Random random = new Random();
            for (int i = 0, j; i < n; i++) {
                j = i + random.nextInt(n - i);
                long randomElement = array[j];
                array[j] = array[i];
                array[i] = randomElement;
            }
            return array;
        }
 
    }
    
    static class DSU {
        private int n;
        private int[] parentOrSize;
        private java.util.ArrayList<java.util.ArrayList<Integer>> map;
    
        public DSU(int n) {
            this.n = n;
            this.map = new java.util.ArrayList<java.util.ArrayList<Integer>>();
            for (int i = 0; i < n; i++) {
                this.map.add(new java.util.ArrayList<Integer>());
                this.map.get(i).add(i);
            }
            this.parentOrSize = new int[n];
            java.util.Arrays.fill(parentOrSize, -1);
        }
    
        int merge(int a, int b) {
            if (!(0 <= a && a < n))
                throw new IndexOutOfBoundsException("a=" + a);
            if (!(0 <= b && b < n))
                throw new IndexOutOfBoundsException("b=" + b);
    
            int x = leader(a);
            int y = leader(b);
            if (x == y)
                return x;
            if (-parentOrSize[x] < -parentOrSize[y]) {
                int tmp = x;
                x = y;
                y = tmp;
            }
            parentOrSize[x] += parentOrSize[y];
            parentOrSize[y] = x;
            this.map.get(x).addAll(this.map.get(y));
            return x;
        }
    
        boolean same(int a, int b) {
            if (!(0 <= a && a < n))
                throw new IndexOutOfBoundsException("a=" + a);
            if (!(0 <= b && b < n))
                throw new IndexOutOfBoundsException("b=" + b);
            return leader(a) == leader(b);
        }
    
        int leader(int a) {
            if (parentOrSize[a] < 0) {
                return a;
            } else {
                parentOrSize[a] = leader(parentOrSize[a]);
                return parentOrSize[a];
            }
        }
    
        int size(int a) {
            if (!(0 <= a && a < n))
                throw new IndexOutOfBoundsException("" + a);
            return -parentOrSize[leader(a)];
        }
    
        java.util.ArrayList<java.util.ArrayList<Integer>> groups() {
            int[] leaderBuf = new int[n];
            int[] groupSize = new int[n];
            for (int i = 0; i < n; i++) {
                leaderBuf[i] = leader(i);
                groupSize[leaderBuf[i]]++;
            }
            java.util.ArrayList<java.util.ArrayList<Integer>> result = new java.util.ArrayList<>(n);
            for (int i = 0; i < n; i++) {
                result.add(new java.util.ArrayList<>(groupSize[i]));
            }
            for (int i = 0; i < n; i++) {
                result.get(leaderBuf[i]).add(i);
            }
            result.removeIf(java.util.ArrayList::isEmpty);
            return result;
        }
    
        void getAdd(int n) {
            for(int t : map.get(n)){
                indegree[t]++;
            }
        }
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
    }
    
    public String[] nextArray(int n) {
        String[] a = new String[n];
        for (int i = 0; i < n; i++)
            a[i] = next();
        return a;
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    }
}