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.*;
import java.util.*;
import java.util.function.Function;

public class MainD {

    static int N, M;
    static char[][] C;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        N = sc.nextInt();
        M = sc.nextInt();
        C = new char[N][];
        for (int i = 0; i < N; i++) {
            C[i] = sc.next().toCharArray();
        }

        boolean ans = solve();
        System.out.println(ans ? "Yes" : "No");
        if( ans ) {
            StringJoiner j = new StringJoiner(" ");
            for (int n : NC) {
                j.add(String.valueOf(n));
            }
            System.out.println( j.toString() );

            j = new StringJoiner(" ");
            for (int m : MC) {
                j.add(String.valueOf(m));
            }
            System.out.println( j.toString() );
        }
    }

    static int[] NC;
    static int[] MC;

    static boolean solve() {
        UnionFind uf = new UnionFind(N+M);
        for (int n = 0; n < N; n++) {
            for (int m = 0; m < M; m++) {
                if( C[n][m] == '=' ) {
                    uf.unite(n, N+m);
                }
            }
        }

        List<int[]> E = new ArrayList<>();
        for (int n = 0; n < N; n++) {
            for (int m = 0; m < M; m++) {
                char c = C[n][m];
                if( c == '>' ) {
                    if( uf.isSame(N+m, n) ) {
                        return false;
                    }
                    E.add( new  int[]{uf.root(N+m), uf.root(n)} );
                } else if( c == '<' ) {
                    if( uf.isSame(n, N+m) ) {
                        return false;
                    }
                    E.add( new  int[]{uf.root(n), uf.root(N+m)} );
                }
            }
        }

        int[][] G = adjD(N+M, E);

        int[][] topo = khan(N+M, G);
        if( topo == null ) return false;

        // debug(topo);

        // 多分分けないほうが楽だがもう動いたし...
        NC = new int[N];
        MC = new int[M];
        for (int[] vr : topo) {
            int v = vr[0];
            int rank = vr[1];

            if( uf.isRoot(v) ) {
                if( vr[0] < N ) {
                    NC[vr[0]] = rank;
                } else {
                    MC[vr[0]-N] = rank;
                }
            }
        }

        for (int i = 0; i < N+M; i++) {
            if( !uf.isRoot(i) ) {
                int r = uf.root(i);
                (i < N ? NC:MC)[i < N ? i : i-N] = (r < N ? NC:MC)[r < N ? r : r-N];
            }
        }

        return true;
    }

    static int[][] khan(int V, int[][] G) {
        int[] deg = new int[V];
        for (int[] tos : G) {
            for (int to : tos) {
                deg[to]++;
            }
        }
        int[][] q = new int[V][2];
        int a = 0, b = 0;
        for (int v = 0; v < V; v++) {
            if( deg[v] == 0 ) {
                q[b][0] = v;
                q[b][1] = 1;
                b++;
            }
        }

        int[][] ret = new int[V][2];
        int idx = 0;
        while( a != b ) {
            int[] vr = q[a++];
            ret[idx++] = vr;
            int v = vr[0];
            int r = vr[1];
            for (int to : G[v]) {
                deg[to]--;
                if( deg[to] == 0 ) {
                    q[b][0] = to;
                    q[b][1] = r+1;
                    b++;
                }
            }
        }

        for (int v = 0; v < V; v++) {
            if( deg[v] != 0 ) return null;
        }
        return ret;
    }

    static int[][] adjD(int n, List<int[]> es) {
        int[][] adj = new int[n][];
        int[] cnt = new int[n];

        for (int[] e : es) {
            cnt[e[0]]++;
        }
        for (int i = 0; i < n; i++) {
            adj[i] = new int[cnt[i]];
        }
        for (int[] e : es) {
            adj[e[0]][--cnt[e[0]]] = e[1];
        }
        return adj;
    }

    static boolean useThisEdge(int[] e, UnionFind uf) {
        return uf.isRoot(e[0]) && uf.isRoot(e[1]);
    }

    static class UnionFind {

        private final int[] parent;
        private final int[] rank;

        public UnionFind(int n) {
            parent = new int[n];
            rank = new int[n];
            for (int i = 0; i < n; i++) {
                parent[i] = i;
                rank[i] = 0;
            }
        }

        public int root(int i) {
            if( parent[i] == i ) {
                return i;
            } else {
                return parent[i] = root(parent[i]);
            }
        }

        public boolean isRoot(int i) {
            return root(i) == i;
        }

        public void unite(int i, int j) {
            int ri = root(i);
            int rj = root(j);
            if( ri == rj ) return;

            if( rank[ri] < rank[rj] ) {
                parent[ri] = rj;

            } else {
                parent[rj] = ri;
                if( rank[ri] == rank[rj] ) {
                    rank[ri]++;
                }
            }
        }

        public boolean isSame(int a, int b) {
            return root(a) == root(b);
        }
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

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

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

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

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

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

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

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

    static <A> void writeLines(A[] as, Function<A, String> f) {
        PrintWriter pw = new PrintWriter(System.out);
        for (A a : as) {
            pw.println(f.apply(a));
        }
        pw.flush();
    }

    static void writeLines(int[] as) {
        PrintWriter pw = new PrintWriter(System.out);
        for (int a : as) pw.println(a);
        pw.flush();
    }

    static void writeLines(long[] as) {
        PrintWriter pw = new PrintWriter(System.out);
        for (long a : as) pw.println(a);
        pw.flush();
    }

    static int max(int... as) {
        int max = Integer.MIN_VALUE;
        for (int a : as) max = Math.max(a, max);
        return max;
    }

    static int min(int... as) {
        int min = Integer.MAX_VALUE;
        for (int a : as) min = Math.min(a, min);
        return min;
    }

    static void debug(Object... args) {
        StringJoiner j = new StringJoiner(" ");
        for (Object arg : args) {
            if (arg instanceof int[]) j.add(Arrays.toString((int[]) arg));
            else if (arg instanceof long[]) j.add(Arrays.toString((long[]) arg));
            else if (arg instanceof double[]) j.add(Arrays.toString((double[]) arg));
            else if (arg instanceof Object[]) j.add(Arrays.toString((Object[]) arg));
            else j.add(arg.toString());
        }
        System.err.println(j.toString());
    }
}