@file:Suppress("NOTHING_TO_INLINE", "EXPERIMENTAL_FEATURE_WARNING", "OVERRIDE_BY_INLINE")

import java.io.PrintWriter
import java.util.StringTokenizer
import kotlin.math.*
import kotlin.random.*
import kotlin.system.exitProcess
import kotlin.collections.sort as _sort
import kotlin.collections.sortDescending as _sortDescending
import kotlin.io.println as iprintln

/** @author Spheniscine */
fun main() {
    output {
        val n = readInt()
        val m = readInt()

        val A = readStrings(n)

        val D = DSU(n + m)

        for(i in 0 until n) {
            for(j in 0 until m) {
                if(A[i][j] == '=') D.join(i, n + j)
            }
        }

        val G = Array(n + m) { IntList() }
        val dom = (0 until n + m).toHashSet()

        for(i in 0 until n) {
            for(j in 0 until m) {
                when(A[i][j]) {
                    '>' -> {
                        G[D.root(i)].add(D.root(n + j))
                        dom.remove(n + j)
                    }
                    '<' -> {
                        G[D.root(n + j)].add(D.root(i))
                        dom.remove(i)
                    }
                }
            }
        }

        val ans = IntArray(n + m)
        val seen = BooleanArray(n + m)
        fun dfs(v: Int): Int = run {
            if(seen[v]) fail()
            seen[v] = true
            when {
                ans[v] != 0 -> ans[v]
                G[v].isEmpty() -> 1
                else -> {
                    var max = 0
                    for (c in G[v]) max = max(max, dfs(c))
                    max + 1
                }
            }
        }.also {
            ans[v] = it
            seen[v] = false
        }

        if(dom.isEmpty()) fail()
        else for (v in dom) if(D.root(v) == v) dfs(v)

        for(i in 0 until n + m) ans[i] = ans[D.root(i)]

        println("Yes")
        println((0 until n).joinToString(" ") { ans[it].toString() })
        println((0 until m).joinToString(" ") { ans[n + it].toString() })
    }
}

fun fail(): Nothing {
    iprintln("No")
    exitProcess(0)
}

class DSU(n: Int) {
    private val id = IntArray(n) { it }
    private val sz = IntArray(n) { 1 }

    tailrec fun root(v: Int): Int =
        if(id[v] == v) v else {
            id[v] = id[id[v]]
            root(id[v])
        }

    /** @return false if the two vertices are already joined, true if the join operation is successful */
    fun join(u: Int, v: Int): Boolean {
        var ru = root(u)
        var rv = root(v)
        if(ru == rv) return false
        if(sz[ru] < sz[rv]) ru = rv.also { rv = ru }
        id[rv] = id[ru]
        sz[ru] += sz[rv]
        return true
    }

    fun isJoined(u: Int, v: Int) = root(u) == root(v)

    fun size(v: Int) = sz[root(v)]
}

class IntList(initialCapacity: Int = 12) {
    var _arr = IntArray(initialCapacity)
    private val capacity get() = _arr.size
    var size = 0
        private set
    inline val lastIndex get() = size - 1
    inline val indices get() = 0 until size

    private fun grow(minCapacity: Int = 2) {
        val newCapacity = maxOf(minCapacity, capacity + (capacity shr 1))
        _arr = _arr.copyOf(newCapacity)
    }

    operator fun get(index: Int): Int {
        require(index in 0 until size)
        return _arr[index]
    }

    operator fun set(index: Int, value: Int) {
        require(index in 0 until size)
        _arr[index] = value
    }

    fun add(value: Int) {
        if(size == capacity) grow()
        _arr[size++] = value
    }

    fun removeLast() = _arr[--size]

    fun clear() { size = 0 }

    operator fun iterator() = object: IntIterator() {
        private var pos = 0
        override fun hasNext() = pos < size
        override fun nextInt() = get(pos++)
    }

    fun isEmpty() = size == 0
}

/** IO code start */
//@JvmField val INPUT = File("input.txt").inputStream()
//@JvmField val OUTPUT = File("output.txt").outputStream()
@JvmField val INPUT = System.`in`
@JvmField val OUTPUT = System.out

@JvmField val _reader = INPUT.bufferedReader()
fun readLine(): String? = _reader.readLine()
fun readLn() = _reader.readLine()!!
@JvmField var _tokenizer: StringTokenizer = StringTokenizer("")
fun read(): String {
    while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return "", " ")
    return _tokenizer.nextToken()
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = List(n) { read() }
fun readLines(n: Int) = List(n) { readLn() }
fun readInts(n: Int) = List(n) { read().toInt() }
fun readIntArray(n: Int) = IntArray(n) { read().toInt() }
fun readDoubles(n: Int) = List(n) { read().toDouble() }
fun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }
fun readLongs(n: Int) = List(n) { read().toLong() }
fun readLongArray(n: Int) = LongArray(n) { read().toLong() }

@JvmField val _writer = PrintWriter(OUTPUT, false)
inline fun output(block: PrintWriter.() -> Unit) { _writer.apply(block).flush() }

/** shuffles and sort overrides to avoid quicksort attacks */
private inline fun <R, V> R._shuffle(rnd: Random, get: R.(Int) -> V, set: R.(Int, V) -> Unit, size: Int) {
    // Fisher-Yates shuffle algorithm
    for (i in size - 1 downTo 1) {
        val j = rnd.nextInt(i + 1)
        val temp = get(i)
        set(i, get(j))
        set(j, temp)
    }
}

@JvmField var _random: Random? = null
val random get() = _random ?: Random(0x594E215C123 * System.nanoTime()).also { _random = it }

fun IntArray.shuffle(rnd: Random = random) = _shuffle(rnd, IntArray::get, IntArray::set, size)
fun IntArray.sort() { shuffle(); _sort() }
fun IntArray.sortDescending() { shuffle(); _sortDescending() }

fun LongArray.shuffle(rnd: Random = random) = _shuffle(rnd, LongArray::get, LongArray::set, size)
fun LongArray.sort() { shuffle(); _sort() }
fun LongArray.sortDescending() { shuffle(); _sortDescending() }

fun DoubleArray.shuffle(rnd: Random = random) = _shuffle(rnd, DoubleArray::get, DoubleArray::set, size)
fun DoubleArray.sort() { shuffle(); _sort() }
fun DoubleArray.sortDescending() { shuffle(); _sortDescending() }

fun CharArray.shuffle(rnd: Random = random) = _shuffle(rnd, CharArray::get, CharArray::set, size)
inline fun CharArray.sort() { _sort() }
inline fun CharArray.sortDescending() { _sortDescending() }

inline fun <T: Comparable<T>> Array<out T>.sort() = _sort()
inline fun <T: Comparable<T>> Array<out T>.sortDescending() = _sortDescending()
inline fun <T: Comparable<T>> MutableList<out T>.sort() = _sort()
inline fun <T: Comparable<T>> MutableList<out T>.sortDescending() = _sortDescending()

fun `please stop removing these imports IntelliJ`() {
    iprintln(max(1, 2))
}


import java.io.BufferedReader
import java.io.InputStreamReader
import java.util.*
import kotlin.math.max
import kotlin.system.exitProcess

fun main() {
    val jin = BufferedReader(InputStreamReader(System.`in`))
    val (n, m) = jin.readLine().split(" ").map { it.toInt() }
    val judgements = Array(n) { jin.readLine() }
    val adjInitial = Array(n + m) { mutableListOf<Int>() }
    for (y in 0 until n) {
        for (x in 0 until m) {
            if (judgements[y][x] == '=') {
                adjInitial[y].add(n + x)
                adjInitial[n + x].add(y)
            }
        }
    }
    val union = IntArray(n + m)
    var j = 0
    val stack = Stack<Int>()
    for (r in 0 until n + m) {
        if (union[r] == 0) {
            j++
            union[r] = j
            stack.push(r)
            while (stack.isNotEmpty()) {
                val a = stack.pop()
                for (b in adjInitial[a]) {
                    if (union[b] == 0) {
                        union[b] = j
                        stack.push(b)
                    }
                }
            }
        }
    }
    val adj = Array(j + 1) { mutableSetOf<Int>() }
    for (y in 0 until n) {
        for (x in 0 until m) {
            if (judgements[y][x] != '=') {
                if (union[y] == union[n + x]) {
                    println("No")
                    return
                } else if (judgements[y][x] == '<') {
                    adj[union[n + x]].add(union[y])
                } else {
                    adj[union[y]].add(union[n + x])
                }
            }
        }
    }
    val memo = IntArray(j + 1)
    val beingCalled = BooleanArray(j + 1)
    fun getRating(a: Int): Int {
        if (beingCalled[a]) {
            println("No")
            exitProcess(0)
        }
        beingCalled[a] = true
        if (memo[a] == 0) {
            memo[a] = 1
            for (b in adj[a]) {
                memo[a] = max(memo[a], getRating(b) + 1)
            }
        }
        beingCalled[a] = false
        return memo[a]
    }
    for (a in 1..j) {
        getRating(a)
    }
    val out = StringBuilder()
    out.appendln("Yes")
    for (y in 0 until n) {
        out.append(memo[union[y]]).append(' ')
    }
    out.appendln()
    for (x in 0 until m) {
        out.append(memo[union[n + x]]).append(' ')
    }
    out.appendln()
    print(out)
}


import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.exit;

public class D {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        Map<String, HashSet<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    String a = "a" + i;
                    String b = "b" + j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<String> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (String v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (String v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        System.out.println("No");
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        System.out.println("No");
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        Map<Set<String>, Set<Set<String>>> lt = new HashMap<>();
        for (Map.Entry<Set<String>, Set<Set<String>>> gtEntry : gt.entrySet()) {
            for (Set<String> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        Map<String, Integer> rates = new HashMap<>();
        List<Set<String>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                System.out.println("No");
                exit(0);
            }
            List<Set<String>> nextMinSets = new ArrayList<>();
            for (Set<String> min : minSets) {
                gt.remove(min);
                for (Set<String> gtSet : lt.get(min)) {
                    Set<Set<String>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                lt.remove(min);
                for (String v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                System.out.println("No");
                exit(0);
            }
            minSets = nextMinSets;
        }
        System.out.println("Yes");
        for (int i = 0; i < n; i++) {
            System.out.print(rates.get("a" + i) + " ");
        }
        System.out.println();
        for (int j = 0; j < m; j++) {
            System.out.print(rates.get("b" + j) + " ");
        }
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        long start = currentTimeMillis();
        Scanner s = new Scanner(new BufferedInputStream(System.in, 1<<20));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out), 1<<20);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        if (n == 453) {
            out.write("1: " + (System.currentTimeMillis() - start));
            out.flush();
        }

        Map<String, HashSet<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        if (n == 453) {
            out.write("2: " + (System.currentTimeMillis() - start));
            out.flush();
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    String a = "a" + i;
                    String b = "b" + j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<String> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (String v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (String v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        if (n == 453) {
            out.write("3: " + (System.currentTimeMillis() - start));
            out.flush();
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        if (n == 453) {
            out.write("4: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Set<String>, Set<Set<String>>> lt = new HashMap<>();
        for (Map.Entry<Set<String>, Set<Set<String>>> gtEntry : gt.entrySet()) {
            for (Set<String> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        if (n == 453) {
            out.write("5: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<String, Integer> rates = new HashMap<>();
        List<Set<String>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        if (n == 453) {
            out.write("6: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            List<Set<String>> nextMinSets = new ArrayList<>();
            for (Set<String> min : minSets) {
                gt.remove(min);
                for (Set<String> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<String>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                for (String v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            minSets = nextMinSets;
        }
        if (n == 453) {
            out.write("7: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get("a" + i) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get("b" + j) + " ");
        }
        out.flush();

        if (n == 453) {
            out.write("7: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        //
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        long start = currentTimeMillis();
        Scanner s = new Scanner(new BufferedInputStream(System.in, 1<<20));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out), 1<<20);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Integer, HashSet<Integer>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put(1024 + i, new HashSet<>(Arrays.asList(1024 + i)));
        for (int i = 0; i < m; i++) vToSet.put(i, new HashSet<>(Arrays.asList(i)));
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    int a = 1024 + i;
                    int b = j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<Integer> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (Integer v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (Integer v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Set<Integer>, Set<Set<Integer>>> gt = new HashMap<>();
        for (Set<Integer> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<Integer> aSet = vToSet.get(1024 + i);
                Set<Integer> bSet = vToSet.get(j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Set<Integer>, Set<Set<Integer>>> lt = new HashMap<>();
        for (Map.Entry<Set<Integer>, Set<Set<Integer>>> gtEntry : gt.entrySet()) {
            for (Set<Integer> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Integer, Integer> rates = new HashMap<>();
        List<Set<Integer>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            List<Set<Integer>> nextMinSets = new ArrayList<>();
            for (Set<Integer> min : minSets) {
                gt.remove(min);
                for (Set<Integer> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<Integer>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                for (Integer v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            minSets = nextMinSets;
        }
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get(1024 + i) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get(j) + " ");
        }
        out.flush();

        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(new BufferedInputStream(System.in, 1 << 20));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out), 1 << 20);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }
        Map<Integer, HashSet<Integer>> vToSet = new HashMap<>(10000);
        for (int i = 0; i < n; i++) vToSet.put(1024 + i, new HashSet<>(Arrays.asList(1024 + i)));
        for (int i = 0; i < m; i++) vToSet.put(i, new HashSet<>(Arrays.asList(i)));
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    int a = 1024 + i;
                    int b = j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<Integer> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (Integer v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (Integer v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        HashMap<Integer, Long> vToId = new HashMap<>();
        {
            long id = 0;
            for (HashSet<Integer> set : vToSet.values()) {
                for (Integer v : set) {
                    vToId.put(v, id);
                }
                ++id;
            }
        }

        Map<Long, Set<Long>> gt = new HashMap<>(10000);
        for (Long id : vToId.values()) {
            gt.put(id, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Long aId = vToId.get(1024 + i);
                Long bId = vToId.get(j);
                if (rs[i][j] == '>') {
                    if (gt.get(bId).contains(aId)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(aId).add(bId);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aId).contains(bId)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(bId).add(aId);
                }
            }
        }
        Map<Long, Set<Long>> lt = new HashMap<>();
        for (Map.Entry<Long, Set<Long>> gtEntry : gt.entrySet()) {
            for (Long lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet<>());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        Map<Long, Integer> rates = new HashMap<>();
        List<Long> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            List<Long> nextMinSets = new ArrayList<>();
            for (Long minId : minSets) {
                gt.remove(minId);
                for (Long gtId : lt.getOrDefault(minId, new HashSet<>())) {
                    Set<Long> gtIds = gt.get(gtId);
                    gtIds.remove(minId);
                    if (gtIds.isEmpty()) {
                        nextMinSets.add(gtId);
                    }
                }
                rates.put(minId, i);
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            minSets = nextMinSets;
        }
        out.write("Yes\n");
        out.write(IntStream.range(0, n)
                .mapToObj(i -> rates.get(vToId.get(1024 + i)).toString())
                .collect(Collectors.joining(" ")));
        out.write("\n");
        out.write(IntStream.range(0, m)
                .mapToObj(j -> rates.get(vToId.get(j)).toString())
                .collect(Collectors.joining(" ")));
        out.flush();
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        long start = currentTimeMillis();
        Scanner s = new Scanner(new BufferedInputStream(System.in, 1<<20));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out), 1<<20);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Integer, HashSet<Integer>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put(1024 + i, new HashSet<>(Arrays.asList(1024 + i)));
        for (int i = 0; i < m; i++) vToSet.put(i, new HashSet<>(Arrays.asList(i)));
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    int a = 1024 + i;
                    int b = j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<Integer> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (Integer v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (Integer v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Set<Integer>, Set<Set<Integer>>> gt = new HashMap<>();
        for (Set<Integer> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<Integer> aSet = vToSet.get(1024 + i);
                Set<Integer> bSet = vToSet.get(j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Set<Integer>, Set<Set<Integer>>> lt = new HashMap<>();
        for (Map.Entry<Set<Integer>, Set<Set<Integer>>> gtEntry : gt.entrySet()) {
            for (Set<Integer> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Integer, Integer> rates = new HashMap<>();
        List<Set<Integer>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            List<Set<Integer>> nextMinSets = new ArrayList<>();
            for (Set<Integer> min : minSets) {
                gt.remove(min);
                for (Set<Integer> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<Integer>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                for (Integer v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            minSets = nextMinSets;
        }
        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get(1024 + i) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get(j) + " ");
        }
        out.flush();

        if (n == 1000 && m == 842) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }

    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(new BufferedInputStream(System.in, 1<<20));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out), 1<<20);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        Map<Integer, HashSet<Integer>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put(1024 + i, new HashSet<>(Arrays.asList(1024 + i)));
        for (int i = 0; i < m; i++) vToSet.put(i, new HashSet<>(Arrays.asList(i)));

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    int a = 1024 + i;
                    int b = j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<Integer> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (Integer v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (Integer v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        Map<Set<Integer>, Set<Set<Integer>>> gt = new HashMap<>();
        for (Set<Integer> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<Integer> aSet = vToSet.get(1024 + i);
                Set<Integer> bSet = vToSet.get(j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }

        Map<Set<Integer>, Set<Set<Integer>>> lt = new HashMap<>();
        for (Map.Entry<Set<Integer>, Set<Set<Integer>>> gtEntry : gt.entrySet()) {
            for (Set<Integer> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        Map<Integer, Integer> rates = new HashMap<>();
        List<Set<Integer>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            List<Set<Integer>> nextMinSets = new ArrayList<>();
            for (Set<Integer> min : minSets) {
                gt.remove(min);
                for (Set<Integer> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<Integer>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                for (Integer v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            minSets = nextMinSets;
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get(1024 + i) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get(j) + " ");
        }
        out.flush();
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        long start = currentTimeMillis();
        Scanner s = new Scanner(new BufferedInputStream(System.in, 1<<20));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out), 1<<20);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        if (n == 453) {
            out.write("1: " + (System.currentTimeMillis() - start));
            out.flush();
        }

        Map<String, HashSet<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        if (n == 453) {
            out.write("2: " + (System.currentTimeMillis() - start));
            out.flush();
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    String a = "a" + i;
                    String b = "b" + j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<String> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (String v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (String v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        if (n == 453) {
            out.write("3: " + (System.currentTimeMillis() - start));
            out.flush();
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        if (n == 453) {
            out.write("4: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Set<String>, Set<Set<String>>> lt = new HashMap<>();
        for (Map.Entry<Set<String>, Set<Set<String>>> gtEntry : gt.entrySet()) {
            for (Set<String> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        if (n == 453) {
            out.write("5: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<String, Integer> rates = new HashMap<>();
        List<Set<String>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        if (n == 453) {
            out.write("6: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            List<Set<String>> nextMinSets = new ArrayList<>();
            for (Set<String> min : minSets) {
                gt.remove(min);
                for (Set<String> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<String>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                for (String v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            minSets = nextMinSets;
        }
        if (n == 453) {
            out.write("7: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get("a" + i) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get("b" + j) + " ");
        }
        out.flush();

        if (n == 453) {
            out.write("7: " + (System.currentTimeMillis() - start));
            out.flush();
        }
    }
}


import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.exit;

public class D {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        Map<String, Set<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    if (!vToSet.get("a" + i).contains("b" + j)) {
                        HashSet<String> joined = new HashSet<>(vToSet.get("a" + i));
                        joined.addAll(vToSet.get("b" + j));
                        for (String v : joined) vToSet.put(v, joined);
                    }
                }
            }
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        System.out.println("No");
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        System.out.println("No");
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        Map<String, Integer> rates = new HashMap<>();
        for (int i = 1; !gt.isEmpty(); ++i) {
            int next = i;
            List<Set<String>> minimal = gt.keySet().stream()
                    .filter(key -> gt.get(key).isEmpty())
                    .collect(Collectors.toList());
            if (minimal.isEmpty()) {
                System.out.println("No");
                exit(0);
            }
            for (Set<String> min : minimal) {
                gt.remove(min);
                for (Set<Set<String>> sets : gt.values()) {
                    sets.remove(min);
                }
                for (String v : min) {
                    rates.put(v, next);
                }
            }
        }
        System.out.println("Yes");
        for (int i = 0; i < n; i++) {
            System.out.print(rates.get("a" + i) + " ");
        }
        System.out.println();
        for (int j = 0; j < n; j++) {
            System.out.print(rates.get("b" + j) + " ");
        }
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        long start = currentTimeMillis();
        Scanner s = new Scanner(new BufferedInputStream(System.in, 1 << 20));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out), 1 << 20);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Integer, HashSet<Integer>> vToSet = new HashMap<>(10000);
        for (int i = 0; i < n; i++) vToSet.put(1024 + i, new HashSet<>(Arrays.asList(1024 + i)));
        for (int i = 0; i < m; i++) vToSet.put(i, new HashSet<>(Arrays.asList(i)));
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    int a = 1024 + i;
                    int b = j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<Integer> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (Integer v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (Integer v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }

        HashMap<Integer, Long> vToId = new HashMap<>();
        {
            long id = 0;
            for (HashSet<Integer> set : vToSet.values()) {
                for (Integer v : set) {
                    vToId.put(v, id);
                }
                ++id;
            }
        }

        Map<Long, Set<Long>> gt = new HashMap<>(10000);
        for (Long id : vToId.values()) {
            gt.put(id, new HashSet<>());
        }
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Long aId = vToId.get(1024 + i);
                Long bId = vToId.get(j);
                if (rs[i][j] == '>') {
                    if (gt.get(bId).contains(aId)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(aId).add(bId);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aId).contains(bId)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(bId).add(aId);
                }
            }
        }
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Long, Set<Long>> lt = new HashMap<>();
        for (Map.Entry<Long, Set<Long>> gtEntry : gt.entrySet()) {
            for (Long lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet<>());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Long, Integer> rates = new HashMap<>();
        List<Long> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            List<Long> nextMinSets = new ArrayList<>();
            for (Long minId : minSets) {
                gt.remove(minId);
                for (Long gtId : lt.getOrDefault(minId, new HashSet<>())) {
                    Set<Long> gtIds = gt.get(gtId);
                    gtIds.remove(minId);
                    if (gtIds.isEmpty()) {
                        nextMinSets.add(gtId);
                    }
                }
                rates.put(minId, i);
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            minSets = nextMinSets;
        }
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get(vToId.get(1024 + i)) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get(vToId.get(j)) + " ");
        }
        out.flush();

        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        ///
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(new BufferedInputStream(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        Map<String, HashSet<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    String a = "a" + i;
                    String b = "b" + j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<String> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (String v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (String v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        out.write("No");
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        out.write("No");
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        Map<Set<String>, Set<Set<String>>> lt = new HashMap<>();
        for (Map.Entry<Set<String>, Set<Set<String>>> gtEntry : gt.entrySet()) {
            for (Set<String> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        Map<String, Integer> rates = new HashMap<>();
        List<Set<String>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                exit(0);
            }
            List<Set<String>> nextMinSets = new ArrayList<>();
            for (Set<String> min : minSets) {
                gt.remove(min);
                for (Set<String> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<String>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                for (String v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                exit(0);
            }
            minSets = nextMinSets;
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get("a" + i) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get("b" + j) + " ");
        }
        out.flush();
    }
}


import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.exit;

public class D {
    public static void main(String[] args) {
        Scanner s = new Scanner("3 4\n" +
                ">>>>\n" +
                ">>>>\n" +
                ">>>>");
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        Map<String, Set<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    if (!vToSet.get("a" + i).contains("b" + j)) {
                        HashSet<String> joined = new HashSet<>(vToSet.get("a" + i));
                        joined.addAll(vToSet.get("b" + j));
                        for (String v : joined) vToSet.put(v, joined);
                    }
                }
            }
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        System.out.println("No");
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        System.out.println("No");
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        Map<String, Integer> rates = new HashMap<>();
        for (int i = 1; !gt.isEmpty(); ++i) {
            int next = i;
            List<Set<String>> minimal = gt.keySet().stream()
                    .filter(key -> gt.get(key).isEmpty())
                    .collect(Collectors.toList());
            if (minimal.isEmpty()) {
                System.out.println("No");
                exit(0);
            }
            for (Set<String> min : minimal) {
                gt.remove(min);
                for (Set<Set<String>> sets : gt.values()) {
                    sets.remove(min);
                }
                for (String v : min) {
                    rates.put(v, next);
                }
            }
        }
        System.out.println("Yes");
        for (int i = 0; i < n; i++) {
            System.out.print(rates.get("a" + i) + " ");
        }
        System.out.println();
        for (int j = 0; j < m; j++) {
            System.out.print(rates.get("b" + j) + " ");
        }
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(new BufferedInputStream(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        Map<String, HashSet<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    String a = "a" + i;
                    String b = "b" + j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<String> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (String v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (String v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        Map<Set<String>, Set<Set<String>>> lt = new HashMap<>();
        for (Map.Entry<Set<String>, Set<Set<String>>> gtEntry : gt.entrySet()) {
            for (Set<String> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        Map<String, Integer> rates = new HashMap<>();
        List<Set<String>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            List<Set<String>> nextMinSets = new ArrayList<>();
            for (Set<String> min : minSets) {
                gt.remove(min);
                for (Set<String> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<String>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                for (String v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            minSets = nextMinSets;
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get("a" + i) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get("b" + j) + " ");
        }
        out.flush();
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        long start = currentTimeMillis();
        Scanner s = new Scanner(new BufferedInputStream(System.in, 1<<20));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out), 1<<20);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Integer, HashSet<Integer>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put(1024 + i, new HashSet<>(Arrays.asList(1024 + i)));
        for (int i = 0; i < m; i++) vToSet.put(i, new HashSet<>(Arrays.asList(i)));
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    int a = 1024 + i;
                    int b = j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<Integer> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (Integer v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (Integer v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Set<Integer>, Set<Set<Integer>>> gt = new HashMap<>();
        for (Set<Integer> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<Integer> aSet = vToSet.get(1024 + i);
                Set<Integer> bSet = vToSet.get(j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Set<Integer>, Set<Set<Integer>>> lt = new HashMap<>();
        for (Map.Entry<Set<Integer>, Set<Set<Integer>>> gtEntry : gt.entrySet()) {
            for (Set<Integer> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Integer, Integer> rates = new HashMap<>();
        List<Set<Integer>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            List<Set<Integer>> nextMinSets = new ArrayList<>();
            for (Set<Integer> min : minSets) {
                gt.remove(min);
                for (Set<Integer> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<Integer>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                for (Integer v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            minSets = nextMinSets;
        }
        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get(1024 + i) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get(j) + " ");
        }
        out.flush();

        if (n == 453 && m == 537) {
            out.write(">> " + (System.currentTimeMillis() - start));
            out.flush();
        }
        ///
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
//        Scanner s = new Scanner(new BufferedInputStream(System.in));
        Scanner s = new Scanner("3 2\n" +
                "==\n" +
                "=<\n" +
                "==");
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        Map<String, HashSet<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    String a = "a" + i;
                    String b = "b" + j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<String> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (String v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (String v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        Map<Set<String>, Set<Set<String>>> lt = new HashMap<>();
        for (Map.Entry<Set<String>, Set<Set<String>>> gtEntry : gt.entrySet()) {
            for (Set<String> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        Map<String, Integer> rates = new HashMap<>();
        List<Set<String>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            List<Set<String>> nextMinSets = new ArrayList<>();
            for (Set<String> min : minSets) {
                gt.remove(min);
                for (Set<String> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<String>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                for (String v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            minSets = nextMinSets;
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get("a" + i) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get("b" + j) + " ");
        }
        out.flush();
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(new BufferedInputStream(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        Map<String, HashSet<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    String a = "a" + i;
                    String b = "b" + j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<String> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (String v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (String v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        out.write("No");
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        out.write("No");
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        Map<Set<String>, Set<Set<String>>> lt = new HashMap<>();
        for (Map.Entry<Set<String>, Set<Set<String>>> gtEntry : gt.entrySet()) {
            for (Set<String> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        Map<String, Integer> rates = new HashMap<>();
        List<Set<String>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                exit(0);
            }
            List<Set<String>> nextMinSets = new ArrayList<>();
            for (Set<String> min : minSets) {
                gt.remove(min);
                for (Set<String> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<String>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                for (String v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                exit(0);
            }
            minSets = nextMinSets;
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get("a" + i) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get("b" + j) + " ");
        }
    }
}


import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.exit;

public class D {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        Map<String, HashSet<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    String a = "a" + i;
                    String b = "b" + j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<String> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (String v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (String v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        System.out.println("No");
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        System.out.println("No");
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        Map<String, Integer> rates = new HashMap<>();
        for (int i = 1; !gt.isEmpty(); ++i) {
            int next = i;
            List<Set<String>> minimal = gt.keySet().stream()
                    .filter(key -> gt.get(key).isEmpty())
                    .collect(Collectors.toList());
            if (minimal.isEmpty()) {
                System.out.println("No");
                exit(0);
            }
            for (Set<String> min : minimal) {
                gt.remove(min);
                for (Set<Set<String>> sets : gt.values()) {
                    sets.remove(min);
                }
                for (String v : min) {
                    rates.put(v, next);
                }
            }
        }
        System.out.println("Yes");
        for (int i = 0; i < n; i++) {
            System.out.print(rates.get("a" + i) + " ");
        }
        System.out.println();
        for (int j = 0; j < m; j++) {
            System.out.print(rates.get("b" + j) + " ");
        }
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(new BufferedInputStream(System.in, 65536));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out), 65536);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        Map<String, HashSet<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    String a = "a" + i;
                    String b = "b" + j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<String> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (String v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (String v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        Map<Set<String>, Set<Set<String>>> lt = new HashMap<>();
        for (Map.Entry<Set<String>, Set<Set<String>>> gtEntry : gt.entrySet()) {
            for (Set<String> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        Map<String, Integer> rates = new HashMap<>();
        List<Set<String>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            List<Set<String>> nextMinSets = new ArrayList<>();
            for (Set<String> min : minSets) {
                gt.remove(min);
                for (Set<String> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<String>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                for (String v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            minSets = nextMinSets;
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get("a" + i) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get("b" + j) + " ");
        }
        out.flush();
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;

public class D {
    public static void main(String[] args) throws IOException {
        long start = currentTimeMillis();
        Scanner s = new Scanner(new BufferedInputStream(System.in, 1<<20));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out), 1<<20);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        if (n == 453) {
            out.write("1: " + (System.currentTimeMillis() - start));
            out.flush();
        }

        Map<String, HashSet<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        if (n == 453) {
            out.write("2: " + (System.currentTimeMillis() - start));
            out.flush();
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    String a = "a" + i;
                    String b = "b" + j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<String> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (String v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (String v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        if (n == 453) {
            out.write("3: " + (System.currentTimeMillis() - start));
            out.flush();
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        out.write("No");
                        out.flush();
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        if (n == 453) {
            out.write("4: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<Set<String>, Set<Set<String>>> lt = new HashMap<>();
        for (Map.Entry<Set<String>, Set<Set<String>>> gtEntry : gt.entrySet()) {
            for (Set<String> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        if (n == 453) {
            out.write("5: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        Map<String, Integer> rates = new HashMap<>();
        List<Set<String>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        if (n == 453) {
            out.write("6: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            List<Set<String>> nextMinSets = new ArrayList<>();
            for (Set<String> min : minSets) {
                gt.remove(min);
                for (Set<String> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<String>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                for (String v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                out.write("No");
                out.flush();
                exit(0);
            }
            minSets = nextMinSets;
        }
        if (n == 453) {
            out.write("7: " + (System.currentTimeMillis() - start));
            out.flush();
        }
        out.write("Yes\n");
        for (int i = 0; i < n; i++) {
            out.write(rates.get("a" + i) + " ");
        }
        out.write("\n");
        for (int j = 0; j < m; j++) {
            out.write(rates.get("b" + j) + " ");
        }
        out.flush();
    }
}


import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.exit;

public class D {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt(), m = s.nextInt();
        char[][] rs = new char[n][];
        for (int i = 0; i < n; i++) {
            rs[i] = s.next().toCharArray();
        }

        Map<String, HashSet<String>> vToSet = new HashMap<>();
        for (int i = 0; i < n; i++) vToSet.put("a" + i, new HashSet<>(Arrays.asList("a" + i)));
        for (int i = 0; i < m; i++) vToSet.put("b" + i, new HashSet<>(Arrays.asList("b" + i)));

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') {
                    String a = "a" + i;
                    String b = "b" + j;
                    if (!vToSet.get(a).contains(b)) {
                        HashSet<String> joined;
                        if (vToSet.get(a).size() > vToSet.get(b).size()) {
                            joined = vToSet.get(a);
                            joined.addAll(vToSet.get(b));
                            for (String v : vToSet.get(b)) vToSet.put(v, joined);
                        } else {
                            joined = vToSet.get(b);
                            joined.addAll(vToSet.get(a));
                            for (String v : vToSet.get(a)) vToSet.put(v, joined);
                        }
                    }
                }
            }
        }

        Map<Set<String>, Set<Set<String>>> gt = new HashMap<>();
        for (Set<String> set : vToSet.values()) {
            gt.put(set, new HashSet<>());
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (rs[i][j] == '=') continue;
                Set<String> aSet = vToSet.get("a" + i);
                Set<String> bSet = vToSet.get("b" + j);
                if (rs[i][j] == '>') {
                    if (gt.get(bSet).contains(aSet)) {
                        System.out.println("No");
                        exit(0);
                    }
                    gt.get(aSet).add(bSet);
                }
                if (rs[i][j] == '<') {
                    if (gt.get(aSet).contains(bSet)) {
                        System.out.println("No");
                        exit(0);
                    }
                    gt.get(bSet).add(aSet);
                }
            }
        }
        Map<Set<String>, Set<Set<String>>> lt = new HashMap<>();
        for (Map.Entry<Set<String>, Set<Set<String>>> gtEntry : gt.entrySet()) {
            for (Set<String> lesser : gtEntry.getValue()) {
                if (!lt.containsKey(lesser)) lt.put(lesser, new HashSet());
                lt.get(lesser).add(gtEntry.getKey());
            }
        }
        Map<String, Integer> rates = new HashMap<>();
        List<Set<String>> minSets = gt.keySet().stream()
                .filter(key -> gt.get(key).isEmpty())
                .collect(Collectors.toList());
        for (int i = 1; !gt.isEmpty(); ++i) {
            if (minSets.isEmpty()) {
                System.out.println("No");
                exit(0);
            }
            List<Set<String>> nextMinSets = new ArrayList<>();
            for (Set<String> min : minSets) {
                gt.remove(min);
                for (Set<String> gtSet : lt.getOrDefault(min, new HashSet<>())) {
                    Set<Set<String>> gtSets = gt.get(gtSet);
                    gtSets.remove(min);
                    if (gtSets.isEmpty()) {
                        nextMinSets.add(gtSet);
                    }
                }
                lt.remove(min);
                for (String v : min) {
                    rates.put(v, i);
                }
            }
            if (nextMinSets.isEmpty() && !gt.isEmpty()) {
                System.out.println("No");
                exit(0);
            }
            minSets = nextMinSets;
        }
        System.out.println("Yes");
        for (int i = 0; i < n; i++) {
            System.out.print(rates.get("a" + i) + " ");
        }
        System.out.println();
        for (int j = 0; j < m; j++) {
            System.out.print(rates.get("b" + j) + " ");
        }
    }
}