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.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @description: 模拟搜索（dfs、dsu、dp、……）
 * @Auther: wuxianhui
 * @Create: 2019/3/6 09:06
 */
public class SimulationSearch {

    private static short[] scoresArray;
    private static short[] equalLeaderArray;
    private static short[] equalLeaderCountArray;
    private static short[] inDegreeArray;
    private static List<Set<Short>> betterList = new ArrayList<>();

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ;
        String input = br.readLine();
        String[] temp = input.split("\\s+");
        if (temp.length>=2){
            short firstDayTastes = Short.parseShort(temp[0]);
            short secondDayTastes = Short.parseShort(temp[1]);
            short totalNum = (short) (firstDayTastes + secondDayTastes);
            scoresArray = new short[totalNum];
            equalLeaderArray = new short[totalNum];
            equalLeaderCountArray = new short[totalNum];
            inDegreeArray =  new short[totalNum];
            for (short i = 0; i < totalNum; i++){
                scoresArray[i] = 0;
                equalLeaderArray[i] = i;
                equalLeaderCountArray[i] = 1;
                inDegreeArray[i]= 0;
                betterList.add(null);
            }
            List<String> compareList = new ArrayList<>();
            for (short i = 0; i < firstDayTastes; i++) {
                input = br.readLine();
                compareList.add(input);
            }
            // 合并相等关系
            for (short i = 0; i < firstDayTastes; i++) {
                input = compareList.get(i);
                for (short j = 0; j < secondDayTastes; j++){
                    if('='==input.charAt(j)){
                        short secondIndex = (short) (firstDayTastes+j);
                        updateEqualEvent(i, secondIndex);
                    }
                }
            }
            //  构建关系图
            boolean success = true;
            for (short i = 0; i < firstDayTastes; i++){
                input = compareList.get(i);
                for (short j = 0; j < secondDayTastes; j++){
                    short secondIndex = (short) (firstDayTastes+j);
                    if ('>'==input.charAt(j)){
                        success = updateBetterEvent(i, secondIndex);
                    } else if('<'==input.charAt(j)){
                        success = updateBetterEvent(secondIndex, i);
                    }
                    if (!success){
                        break;
                    }
                }
                if (!success){
                    break;
                }
            }
            // 计算评分
            if (success){
                Set<Short> firstLeaders = new HashSet<>();
                for (short i = 0; i < totalNum; i++){
                    short leader = findEqualLeader(i);
                    if (inDegreeArray[leader]==0 && !firstLeaders.contains(leader)){
                        firstLeaders.add(leader);
                    }
                }
                // 从顶点开始更新，先更新leader的值,采用拓扑排序算法（有环则更新不完）
                updateLeaderScore(firstLeaders);
                // 补充更新非leader的值
                for (short i = 0; i < totalNum; i++){
                    if (scoresArray[i]>0){
                        continue;
                    }
                    short leader = findEqualLeader(i);
                    if (scoresArray[leader]<=0){
                        // 存在环,导致leader未赋值
                        success = false;
                        break;
                    }
                    scoresArray[i] = scoresArray[leader];
                }
            }
            // 打印结果
            if (success){
                System.out.println("Yes");
                for (short i = 0; i < firstDayTastes; i++){
                    if (i>0){
                        System.out.print(" " + scoresArray[i]);
                    } else{
                        System.out.print(scoresArray[i]);
                    }
                }
                System.out.println("");
                for (short i = firstDayTastes; i < totalNum; i++){
                    if (i>firstDayTastes){
                        System.out.print(" " + scoresArray[i]);
                    } else{
                        System.out.print(scoresArray[i]);
                    }
                }
                System.out.println("");
            } else{
                System.out.println("No");
            }
        }
        br.close();
    }

    /**
     * 处理大于关系
     * @param betterIndex
     * @param poorerIndex
     * @return
     */
    private static boolean updateBetterEvent(short betterIndex, short poorerIndex){
        // 在同一层的leader节点构建better关系图,采用集合保存直接大于当前节点的其他节点
        short betterLeader = findEqualLeader(betterIndex);
        short poorLeader = findEqualLeader(poorerIndex);
        if (betterLeader==poorLeader){
            // 关系冲突
            return false;
        }
        Set<Short> upperSet = betterList.get(poorLeader);
        if (upperSet==null){
            upperSet = new HashSet<>();
            betterList.set(poorLeader, upperSet);
        }
        if (!upperSet.contains(betterLeader)) {
            upperSet.add(betterLeader);
            inDegreeArray[betterLeader] ++;
        }
        return true;
    }

    /**
     * 处理等于关系:dsu-合并群组
     * @param firstIndex
     * @param secondIndex
     * @return
     */
    private static boolean updateEqualEvent(short firstIndex, short secondIndex){
        // 添加相等关系，采用dsu（并查集）结构
        short firstLeader = findEqualLeader(firstIndex);
        short secondLeader = findEqualLeader(secondIndex);
        if (firstLeader!=secondLeader){
            // 相等合并
            if (equalLeaderCountArray[firstLeader]>equalLeaderCountArray[secondLeader]){
                equalLeaderArray[secondLeader] = firstLeader;

            } else{
                if (equalLeaderCountArray[firstLeader]==equalLeaderCountArray[secondLeader]){
                    equalLeaderCountArray[secondLeader] ++;
                }
                equalLeaderArray[firstLeader] = secondLeader;
            }
        }
        return true;
    }

    /**
     * dsu:查找相等群组leader，压缩路径，并同步better节点以及最差节点标识
     * @param index
     * @return
     */
    private static short findEqualLeader(short index){
        if (equalLeaderArray[index]==index){
            return index;
        }
        short leader = findEqualLeader(equalLeaderArray[index]);
        if (equalLeaderArray[index]!=leader){
            equalLeaderArray[index] = leader;
        }
        return leader;
    }

    /**
     * 从一个leader节点触发，级联更新其他相关节点的分数。采用dfs深度搜索的方式
     * @param currLeaders 第一批（入度为0）leader集合
     * @return
     */
    private static void updateLeaderScore(Set<Short> currLeaders){
        short score = 1;
        Set<Short> tempLeaders = new HashSet<>();
        while (!currLeaders.isEmpty()){
            for (short leader : currLeaders){
                scoresArray[leader] = score;
                Set<Short> betterSet = betterList.get(leader);
                if (betterSet!=null && betterSet.size()>0){
                    for (short betterIndex : betterSet){
                        // 删边
                        inDegreeArray[betterIndex] --;
                        // 边删完了再设值，避免重复设置，且取的是最大值
                        if (inDegreeArray[betterIndex]==0){
                            tempLeaders.add(betterIndex);
                        }
                    }
                }
            }
            currLeaders.clear();
            currLeaders.addAll(tempLeaders);
            tempLeaders.clear();
            score ++;
        }
    }

}
