fun main(args: Array<String>) {
    val (H, W) = readLine()!!.split(" ").map { it.toInt() }
    val s = mutableListOf<CharArray>()
    (1..H).forEach {
        s.add(readLine()!!.map { it }.toCharArray())
    }

    fun continuesAreaSize(h: Int, w: Int) : Int {
        val arePramsValid = 0 <= w && w < W && 0 <= h && h < H
        if (!arePramsValid) {
            return 0
        }

        if (s[h][w] == '.') {
            return 0
        }

        // Mark as visited
        s[h][w] = '.'
        return 1 + continuesAreaSize(h + 1, w) + continuesAreaSize(h - 1, w) + continuesAreaSize(h, w + 1) + continuesAreaSize(h, w - 1)
    }

    (0..(H-1)).forEach {h ->
        (0..(W-1)).forEach {w ->
            if (s[h][w] != '.') {
                if (continuesAreaSize(h, w) == 1) {
                    println("No")
                    return
                }
            }
        }
    }
    println("Yes")
}
