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.text.*;
//Solution Credits: Taranpreet Singh
public class Main{
    //SOLUTION BEGIN
    void pre() throws Exception{}
    void solve(int TC) throws Exception{
        int n = ni(), m = ni(), xx = 0;
        int[] set = new int[n+m];
        for(int i = 0; i< n+m; i++)set[i] = i;
        char[][] g = new char[n][m];
        for(int i = 0; i< n; i++){
            String s = n();
            for(int j = 0; j< m; j++){
                g[i][j] = s.charAt(j);
                if(g[i][j]=='='){
                    set[find(set, n+j)] = i;xx++;
                }
            }
        }
        boolean val = true;
        int[][] e = new int[n*m-xx][];xx = 0;
        for(int i = 0; i< n && val; i++)
            for(int j = 0; j< m && val; j++){
                if(g[i][j]!='='){
                    int x = find(set, i), y = find(set, n+j);
                    if(x==y)val = false;
                }
                if(g[i][j]=='<')e[xx++] = new int[]{find(set, i), find(set, n+j)};
                else if(g[i][j]=='>')e[xx++] = new int[]{find(set, n+j), find(set, i)};
            }
        if(!val){
            pn("No");return;
        }
        int[][] gr = makeD(n+m, e);
        if(isCyclic(gr))pn("No");
        else{
            int[] deg = new int[n+m];
            TreeSet<Integer> se = new TreeSet<>();
            int[] ans = new int[n+m];
            for(int[] ee:e)deg[ee[1]]++;
            for(int i = 0; i< n+m; i++){
                if(find(set, i)!=i)continue;
                if(deg[i]==0){
                    ans[i] = 1;
                    se.add(i);
                }
            }
            while(!se.isEmpty()){
                int x = se.pollFirst();
                for(int v:gr[x]){
                    deg[v]--;
                    if(deg[v]==0){
                        ans[v] = ans[x]+1;
                        se.add(v);
                    }
                }
            }
            pn("Yes");
            for(int i = 0; i< n; i++)p(ans[find(set, i)]+" ");pn("");
            for(int i = 0; i< m; i++)p(ans[find(set, n+i)]+" ");pn("");
        }
    }
    private boolean isCyclicUtil(int[][] g, int i, boolean[] visited, boolean[] recStack){ 
        if (recStack[i])return true; 
        if (visited[i])return false; 
        visited[i] = true; 
        recStack[i] = true;
        for(int x:g[i])
            if(isCyclicUtil(g, x, visited, recStack))
                return true;
        recStack[i] = false;
        return false; 
    }
    private boolean isCyclic(int[][] g){
        
        boolean[] visited = new boolean[g.length]; 
        boolean[] recStack = new boolean[g.length]; 
          
          
        // Call the recursive helper function to 
        // detect cycle in different DFS trees 
        for (int i = 0; i < g.length; i++) 
            if (isCyclicUtil(g, i, visited, recStack)) 
                return true; 
  
        return false; 
    } 
    int[][] makeD(int n, int[][] edge){
        int[][] g = new int[n][]; ;int[] cnt = new int[n];
        for(int i = 0; i< edge.length; i++)cnt[edge[i][0]]++;
        for(int i = 0; i< n; i++)g[i] = new int[cnt[i]];
        for(int i = 0; i< edge.length; i++)g[edge[i][0]][--cnt[edge[i][0]]] = edge[i][1];
        return g;
    }
    int find(int[] set, int i){
        if(set[i]==i)return i;
        return set[i] = find(set, set[i]);
    }
    //SOLUTION END
    void hold(boolean b)throws Exception{if(!b)throw new Exception("Hold right there, Sparky!");}
    long mod = (long)1e9+7, IINF = (long)1e18;
    final int INF = (int)1e9, MX = (int)5e6+2;
    DecimalFormat df = new DecimalFormat("0.00000000000");
    double PI = 3.1415926535897932384626433832792884197169399375105820974944, eps = 1e-8;
    static boolean multipleTC = false, memory = false;
    FastReader in;PrintWriter out;
    void run() throws Exception{
        in = new FastReader();
        out = new PrintWriter(System.out);
        int T = (multipleTC)?ni():1;
        //Solution Credits: Taranpreet Singh
        pre();for(int t = 1; t<= T; t++)solve(t);
        out.flush();
        out.close();
    }
    public static void main(String[] args) throws Exception{
        if(memory)new Thread(null, new Runnable() {public void run(){try{new Main().run();}catch(Exception e){e.printStackTrace();}}}, "1", 1 << 28).start();
        else new Main().run();
    }
    long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
    int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
    int bit(long n){return (n==0)?0:(1+bit(n&(n-1)));}
    void p(Object o){out.print(o);}
    void pn(Object o){out.println(o);}
    void pni(Object o){out.println(o);out.flush();}
    String n()throws Exception{return in.next();}
    String nln()throws Exception{return in.nextLine();}
    int ni()throws Exception{return Integer.parseInt(in.next());}
    long nl()throws Exception{return Long.parseLong(in.next());}
    double nd()throws Exception{return Double.parseDouble(in.next());}

    class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws Exception{
            br = new BufferedReader(new FileReader(s));
        }

        String next() throws Exception{
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException  e){
                    throw new Exception(e.toString());
                }
            }
            return st.nextToken();
        }

        String nextLine() throws Exception{
            String str = "";
            try{   
                str = br.readLine();
            }catch (IOException e){
                throw new Exception(e.toString());
            }  
            return str;
        }
    }
}