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.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.lang.invoke.MethodHandles;
import java.math.BigInteger;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.TreeSet;

public final class CF_541_D2_De
{


	static boolean verb=true;
	static void log(Object X){if (verb) System.err.println(X);}
	static void log(Object[] X){if (verb) {for (Object U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X){if (verb) {for (int U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X,int L){if (verb) {for (int i=0;i<L;i++) System.err.print(X[i]+" ");System.err.println("");}}
	static void log(long[] X){if (verb) {for (long U:X) System.err.print(U+" ");System.err.println("");}}

	static void logWln(Object X){if (verb) System.err.print(X);}
	static void info(Object o){	System.out.println(o);}
	static void output(Object o){outputWln(""+o+"\n");	}
	static void outputWln(Object o){try {out.write(""+ o);} catch (Exception e) {}}

	static long mod=1000000007;

	// Global vars
	static BufferedWriter out;
	static InputReader reader;





	static void test() {
		log("testing");



		log("done");
	}

	static int[] anc,rank,max,list;


	static void initSet(int x){
		anc[x]=x;
		rank[x]=0;
		max[x]=x;
	}

	static int union(int x,int y){
		//log("unioning x:"+x+" y:"+y);
		int xr=find(x);
		int yr=find(y);
		if (xr!=yr){
			if (rank[xr]<rank[yr]){
				anc[xr]=yr;
				max[yr]=Math.max(max[xr],max[yr]);
				return yr;
				//	max[xr]=max[yr];
			} else if (rank[xr]>rank[yr]) {
				anc[yr]=xr;
				max[xr]=Math.max(max[xr],max[yr]);
				//	max[xr]=max[yr];
				return xr;
			} else {
				anc[yr]=xr;
				rank[xr]++;
				max[xr]=Math.max(max[xr],max[yr]);
				//max[xr]=max[yr];
				return xr;
			}

		}
		return -1;
	}

	static int find(int x){
		if (anc[x]!=x){
			anc[x]=find(anc[x]);
		}
		return anc[x]; 
	}



	static void process() throws Exception {

		out = new BufferedWriter(new OutputStreamWriter(System.out));
		reader = new InputReader(System.in);

		int n=reader.readInt();
		int m=reader.readInt();
		int nm=n+m;
	


		HashSet<Integer>[] upper=new HashSet[nm];
		HashSet<Integer>[] lower=new HashSet[nm];


		for (int i=0;i<nm;i++) {
			upper[i]=new HashSet<Integer>();
			lower[i]=new HashSet<Integer>();
			
		}

		anc=new int[nm];
		rank=new int[nm];
		max=new int[nm];
		for (int i=0;i<nm;i++)
			initSet(i);

		String[] s=new String[n];
		// first pass, merge
		for (int i=0;i<n;i++) {
			s[i]=reader.readString();
			int u=i;
			for (int j=0;j<m;j++) {
				int v=j+n;
				char c=s[i].charAt(j);
				if (c=='=') {
					union(u,v);
				}
			}
		}

		for (int i=0;i<n;i++) {
			int u=find(i);
			for (int j=0;j<m;j++) {
				int v=find(j+n);
				char c=s[i].charAt(j);
				if (c=='>') {
					upper[v].add(u);
					lower[u].add(v);
				}
				if (c=='<') {
					upper[u].add(v);
					lower[v].add(u);
				}
			}
		}

		
		ArrayList<Integer>[] friends=new ArrayList[nm];
		for (int u=0;u<nm;u++) {
			if (u==find(u)) {
				
				friends[u]=new ArrayList<Integer>();
				friends[u].addAll(lower[u]);
			}
		}
		
		int[] it=new int[nm];
		int tot=0;
		int processed=0;
		int[] stack=new int[nm];
		int st=0;
		// now dfs starting from the lowest
		int time=0;
		int[] onstack=new int[nm];
		boolean[] visited=new boolean[nm];
		boolean error=false;
		int[] score=new int[nm];
		Arrays.fill(score, -1);
		loop:for (int u=0;u<nm;u++) {
			if (u==anc[u]) {
				tot++;
				if (!visited[u]) {
					if (upper[u].size()==0) {
						//log("processing u:"+u);
						time++;
						st=0;
						stack[st++]=u;
						onstack[u]=time;
						it[u]=0;
						score[u]=1;
						visited[u]=true;
						while (st>0) {
							int v=stack[st-1];
							
							if (it[v]==friends[v].size()) {
								onstack[v]=-1;
								it[v]=0;
								score[v]=1;
								for (int w:friends[v]) {
									if (score[v]<=score[w])
										score[v]=score[w]+1;
								}
								st--;
							} else {
								int w=friends[v].get(it[v]++);
								if (onstack[w]==time) {
									error=true;
									//log("found loop");
									break loop;
								} else {
									if (!visited[w]) {
										it[w]=0;
										onstack[w]=time;
										stack[st++]=w;
										visited[w]=true;
									}
								}
							}
						}
					}
				}
			}
		}

		if (!error) {
			// check for error
			for (int i=0;i<nm;i++) {
				int u=find(i);
				if (score[u]==-1) {
					//log("non allocated u:"+u);
					error=true;
					break;
				}
			}
		}
		if (error) {
			output("No");
		} else {
			output("Yes");
			for (int i=0;i<n;i++) {
				int u=find(i);
				output(score[u]);
			}
			output("");
			for (int i=n;i<nm;i++) {
				int u=find(i);
				output(score[u]);
			}
			output("");
			
		}

		try {
			out.close();
		} catch (Exception e) {
		}

	}

	public static void main(String[] args) throws Exception {
		process();

	}

	static final class InputReader {
		private final InputStream stream;
		private final byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		private int read() throws IOException {
			if (curChar >= numChars) {
				curChar = 0;
				numChars = stream.read(buf);
				if (numChars <= 0) {
					return -1;
				}
			}
			return buf[curChar++];
		}

		public final String readString() throws IOException {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.append((char) c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public final int readInt() throws IOException {
			int c = read();
			boolean neg = false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d = (char) c;
			// log("d:"+d);
			if (d == '-') {
				neg = true;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			// log("res:"+res);
			if (neg)
				return -res;
			return res;

		}

		public final long readLong() throws IOException {
			int c = read();
			boolean neg = false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d = (char) c;
			// log("d:"+d);
			if (d == '-') {
				neg = true;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			// log("res:"+res);
			if (neg)
				return -res;
			return res;

		}

		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	}

}