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.*;
import java.math.BigInteger;
public class A{
    static PrintWriter out;
    static InputReader in;
    public static void main(String args[]){
        out = new PrintWriter(System.out);
        in = new InputReader();
        new A();
        out.flush(); out.close();
    }   
    final int max = 2010;
    int n, m, p[], r[], tot;
    int from[] = new int[max * max], to[] = new int[max * max], e = 0;
    int ja[][], c[];
    char ch[][];
    boolean sp[];
    boolean rs = true;
    ArrayList<Integer> al[] = new ArrayList[max];
    int get(int u){
        return p[u] == u ? u : (p[u] = get(p[u]));
    }
    void merge(int u, int v){
        int pu = get(u), pv = get(v);
        if(r[pu] == r[pv])r[pu]++;
        if(r[pu] < r[pv]){
            pu ^= pv; pv ^= pu; pu ^= pv;
        }
        p[pv] = pu;
    }
    A(){
        n = in.nextInt(); m = in.nextInt();
        tot = n + m + 1;
        p = new int[tot]; r = new int[tot];
        for(int i = 1; i < tot; i++){
            p[i] = i;
        }
        ch = new char[n][];
        for(int i = 0; i < n; i++)ch[i] = in.next().trim().toCharArray();

        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                if(ch[i][j] == '='){
                    merge(i + 1, n + j + 1);
                }
            }
        }
        for(int i = 0; i < max; i++)al[i] = new ArrayList<>();
        sp = new boolean[tot];
        for(int i = 1; i < tot; i++){
            p[i] = get(i);
            al[p[i]].add(i);
            sp[p[i]] = true;
        }

        o : for(int i = 0; i < max; i++){
            int sz = al[i].size();
            if(sz < 2)continue;
            // System.out.println(al[i]);
            for(int j = 0; j < sz; j++){
                int f = al[i].get(j);
                if(f > n)continue;
                for(int k = 0; k < sz; k++){
                    int s = al[i].get(k);
                    if(s <= n)continue;
                    s -= n;
                    if(ch[f - 1][s - 1] != '='){
                        rs = false;
                        break o;
                    }
                }
            }
        }

        for(int i = 1; i <= n; i++){
            if(sp[p[i]] == true){
                int sz = al[p[i]].size();
                for(int j = 0; j < sz; j++){
                    int t = al[p[i]].get(j);
                    if(t <= n){
                        for(int k = 1; k <= m; k++){
                            if(ch[t - 1][k - 1] == '=')continue;
                            if(ch[t - 1][k - 1] == '>'){
                                from[e] = p[k + n]; to[e++] = p[i];
                            }else{
                                from[e] = p[i]; to[e++] = p[k + n];
                            }
                        }
                    }else{
                        t -= n;
                        for(int k = 1; k <= n; k++){
                            if(ch[k - 1][t - 1] == '=')continue;
                            if(ch[k - 1][t - 1] == '>'){
                                from[e] = p[i]; to[e++] = p[k];
                            }else{
                                from[e] = p[k]; to[e++] = p[i];
                            }
                        }
                    }
                }
                sp[p[i]] = false;
            }
        }

        ja = new int[tot][]; c = new int[tot];
        for(int i = 0; i < e; i++){
            c[from[i]]++; cc[to[i]]++;
            // System.out.println(from[i] + " " + to[i]);
        }
        for(int i = 1; i < tot; i++){
            ja[i] = new int[c[i]]; c[i] = 0;
        }
        for(int i = 0; i < e; i++){
            ja[from[i]][c[from[i]]++] = to[i];
        }

        for(int i = 1; i < tot; i++){
            if(cc[p[i]] == 0 && !visit[p[i]]){
                int u = p[i];
                ad.add(u); order[u] = 1;
                visit[u] = true;
            }
        }

        while(!ad.isEmpty()){
            // System.out.println(ad);
            int u = ad.pollFirst();
            for(int v : ja[u]){
                if(--cc[v] == 0){
                    ad.addLast(v); order[v] = order[u] + 1;
                    visit[v] = true;
                }
            }
        }

        for(int i = 1; i < tot; i++){
            if(!visit[p[i]]){
                rs = false; break;
            }
        }

        if(!rs){
            out.print("No");
        }else{
            out.println("Yes");
            for(int i = 1; i <= n; i++){
                out.print(order[p[i]] + " ");
            }
            out.println();
            for(int i = 1; i <= m; i++){
                out.print(order[p[i + n]] + " ");
            }
        }

        // solve();
    }
    ArrayDeque<Integer> ad = new ArrayDeque<>();
    boolean visit[] = new boolean[max];
    int order[] = new int[max];
    int cc[] = new int[max];

    void solve(){
        int n = in.nextInt();
        long ans = 0;
        long ap = 0, bp = 0;
        for(int i = 0; i < n; i++){
            long a = in.nextLong(), b = in.nextLong();
            if(ap == a && bp == b && i != 0)continue;
            ans += Math.max(Math.min(a, b) - Math.max(ap, bp) + 1, 0);
            ap = a; bp = b;
        }out.print(ans);
    }
    public static class InputReader{
        BufferedReader br;
        StringTokenizer st;
        InputReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public long nextLong(){
            return Long.parseLong(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
        public String next(){
            while(st == null || !st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch(IOException e){}
            }
            return st.nextToken();
        }
    }
}