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:
/*Author: Satyajeet Singh, Delhi Technological University*/
import java.io.*;
import java.util.*;
import java.text.*; 
import java.lang.*;

public class Main {
/*********************************************Constants******************************************/
    static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));        
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static long mod=(long)1e9+7;
    static long mod1=998244353;
    static boolean sieve[];
    static ArrayList<Integer> primes;
    static ArrayList<Long> factorial;
    static HashSet<Integer> graph[];
/****************************************Solutions Begins*****************************************/
    static int dsu[];
    static int dsu_size[];
    static void setInit(int n){
        dsu=new int[n];
        dsu_size=new int[n];
        Arrays.fill(dsu,-1);
        Arrays.fill(dsu_size,0);
    }
    static void makeSet(int v){
        dsu[v]=v;
        dsu_size[v]=1;
    }
    static int findSet(int v){
        if(dsu[v]==v){
            return v;
        }
        int v1=findSet(dsu[v]);
        dsu[v]=v1;
        return v1;
    }
    static void union(int s1,int s2){
        int a=findSet(s1);
        int b=findSet(s2);
        if(a!=b){
            if(dsu_size[s1]>dsu_size[s2]){
                int temp=s1;
                s1=s2;
                s2=temp;
            }
            dsu[s1]=s2;
            dsu_size[s1]+=dsu_size[s2];
        }
    }
    public static void main (String[] args) throws Exception {
        String st[]=br.readLine().split(" ");
        int n=Integer.parseInt(st[0]);
        int m=Integer.parseInt(st[1]);
        setInit(n+m);
        Makegraph(n+m);
        String input[]=new String[n];
        for(int i=0;i<n+m;i++){
            makeSet(i);
        }
        for(int i=0;i<n;i++){
            st=br.readLine().split(" ");
            input[i]=st[0];
            for(int j=0;j<m;j++){
                char a=st[0].charAt(j);
                if(a=='='){
                    union(i,n+j);           
                }
            }
        }
        int indeg[]=new int[n+m];
        Arrays.fill(indeg,0);
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                if(input[i].charAt(j)=='>'){
                    int ii=findSet(i);
                    int jj=findSet(n+j);
                    addEdge(ii,jj);                   
                }
                else if(input[i].charAt(j)=='<'){
                    int ii=findSet(i);
                    int jj=findSet(n+j);
                    addEdge(jj,ii);
                }
            }
        }
        for(int i=0;i<n+m;i++){
            for(int u:graph[i]){
                indeg[u]++;
            }
        }
      //  //debug(set);
       // debug(graph);
        Queue<Integer> q=new ArrayDeque<>();
        boolean vis[]=new boolean[n+m];
        Arrays.fill(vis,false);
        int dp[]=new int[n+m];
        Arrays.fill(dp,1001);

        for(int i=0;i<n+m;i++){
            int id=findSet(i);
            if(indeg[id]==0&&!vis[id]){
                q.add(id);
                vis[id]=true;
            }
        }
        //topological Sort
       // debug(indeg);
       int itr=0;
        while(!q.isEmpty()){
           // System.out.println("HI");
          //  debug(q);
            itr++;
            if(itr>1000000){
                System.out.println("Problem");
                return;
            }
            int a=q.remove();
            for(int u:graph[a]){
                if(vis[u]){
                    out.println("No");
                    out.flush();
                    return;
                }
                else{
                    indeg[u]--;
                    if(indeg[u]==0){
                        q.add(u);
                        dp[u]=dp[a]-1;
                        vis[u]=true;
                    }
                }
            }
        }
        for(int i=0;i<n+m;i++){
            if(indeg[i]>0){
                out.println("No");
                out.flush();
                return;
            }
        }
        out.println("Yes");
       // debug(dp);
        int min=Integer.MAX_VALUE;
        for(int i=0;i<n+m;i++){
            min=Math.min(min,dp[i]);
        }
        for(int i=0;i<n+m;i++){
            dp[i]-=min-1;
        }
        //debug(dp);
        for(int i=0;i<n;i++){
            int idx=findSet(i);
            out.print(dp[idx]+" ");
        }
        out.println();
        for(int i=0;i<m;i++){
            int idx=findSet(n+i);
            out.print(dp[idx]+" ");
        }
       // debug(dsu);
/****************************************Solutions Ends**************************************************/
        out.flush();
        out.close();
    }
/****************************************Template Begins************************************************/
/***************************************Precision Printing**********************************************/
    static void printPrecision(double d){
        DecimalFormat ft = new DecimalFormat("0.00000000000000000"); 
        out.println(ft.format(d));
    }
/******************************************Graph*********************************************************/
    static void Makegraph(int n){
        graph=new HashSet[n];
        for(int i=0;i<n;i++){
            graph[i]=new HashSet<>();
        }
    }
    static void addEdge(int a,int b){
        graph[a].add(b);
    }    

/*********************************************PAIR********************************************************/
    static class PairComp implements Comparator<Pair>{
        public int compare(Pair p1,Pair p2){
            if(p1.u>p2.u){
                return 1;
            }
            else if(p1.u<p2.u){
                return -1;
            }
            else{
                return p1.v-p2.v;
            }
        }
    }
    static class Pair implements Comparable<Pair> {
        int u;
        int v;
        int index=-1;
        public Pair(int u, int v) {
            this.u = u;
            this.v = v;
        }
 
        public int hashCode() {
            int hu = (int) (u ^ (u >>> 32));
            int hv = (int) (v ^ (v >>> 32));
            return 31 * hu + hv;
        }
 
        public boolean equals(Object o) {
            Pair other = (Pair) o;
            return u == other.u && v == other.v;
        }
 
        public int compareTo(Pair other) {
            if(index!=other.index)
                return Long.compare(index, other.index);
            return Long.compare(v, other.v)!=0?Long.compare(v, other.v):Long.compare(u, other.u);
        }
 
        public String toString() {
            return "[u=" + u + ", v=" + v + "]";
        }
    }

    static class PairCompL implements Comparator<Pairl>{
        public int compare(Pairl p1,Pairl p2){
            if(p1.u>p2.u){
                return 1;
            }
            else if(p1.u<p2.u){
                return -1;
            }
            else{
                return 0;
            }
        }
    }
    static class Pairl implements Comparable<Pair> {
            long u;
            long v;
            int index=-1;
            public Pairl(long u, long v) {
                this.u = u;
                this.v = v;
            }
    
            public int hashCode() {
                int hu = (int) (u ^ (u >>> 32));
                int hv = (int) (v ^ (v >>> 32));
                return 31 * hu + hv;
            }
    
            public boolean equals(Object o) {
                Pair other = (Pair) o;
                return u == other.u && v == other.v;
            }
    
            public int compareTo(Pair other) {
                if(index!=other.index)
                    return Long.compare(index, other.index);
                return Long.compare(v, other.v)!=0?Long.compare(v, other.v):Long.compare(u, other.u);
            }
    
            public String toString() {
                return "[u=" + u + ", v=" + v + "]";
            }
        }
/*****************************************DEBUG***********************************************************/
    public static void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }
/************************************MODULAR EXPONENTIATION***********************************************/
    static long modulo(long a,long b,long c) {
        long x=1;
        long y=a;
        while(b > 0){
            if(b%2 == 1){
                x=(x*y)%c;
            }
            y = (y*y)%c; // squaring the base
            b /= 2;
        }
        return  x%c;
    }
/********************************************GCD**********************************************************/
    static long gcd(long x, long y)
    {
        if(x==0)
            return y;
        if(y==0)
            return x;
        long r=0, a, b;
        a = (x > y) ? x : y; // a is greater number
        b = (x < y) ? x : y; // b is smaller number
        r = b;
        while(a % b != 0)
        {
            r = a % b;
            a = b;
            b = r;
        }
        return r;
    }
/******************************************SIEVE**********************************************************/
    static void sieveMake(int n){
        sieve=new boolean[n];
        Arrays.fill(sieve,true);
        sieve[0]=false;
        sieve[1]=false;
        for(int i=2;i*i<n;i++){
            if(sieve[i]){
                for(int j=i*i;j<n;j+=i){
                    sieve[j]=false;
                }
            }
        }
        primes=new ArrayList<Integer>();
        for(int i=0;i<n;i++){
            if(sieve[i]){
                primes.add(i);
            }
        }        
    }
/********************************************End***********************************************************/
}