import java.util.*

fun main(args: Array<String>) = codeFestival2017QualAC()

fun codeFestival2017QualAC() {
    val (h, w) = readLine()!!.split(' ').map { it.toInt() }
    val a = (1..h).flatMap { readLine()!!.toList() }

    val queue = PriorityQueue(h * w,
        Comparator { o1: Int, o2: Int -> o2 - o1 })
    queue.addAll(a.groupBy { it }.map { it.value.size })

    fun simulate(take: Int, takePer: Int): Boolean {
        var remainToTake = take
        while (remainToTake > 0) {
            val poll = queue.poll()
            val remain = poll - takePer
            remainToTake -= takePer
            if (remain < 0) return false
            if (remain > 0) queue.add(remain)
        }
        return true
    }

    val centerHeight = h % 2
    val centerWidth = w % 2

    val takeCorners = (h / 2) * (w / 2) * 4
    val takePerCorner = 4

    val takeVertical = (w % 2) * h - centerHeight
    val takePerVertical = centerWidth * 2

    val takeHorizontal = (h % 2) * w - centerWidth
    val takePerHorizontal = centerHeight * 2

    val answer = if (simulate(takeCorners, takePerCorner)
        && simulate(takeVertical, takePerVertical)
        && simulate(takeHorizontal, takePerHorizontal)
    ) "Yes" else "No"

    println(answer)
}
