let [| H; W |] = stdin.ReadLine().Split(' ') |> Array.map int let mutable sample = None let S = [ for i in 0 .. H-1 do let s = stdin.ReadLine().Trim() yield [ for j in 0 .. s.Length - 1 do if s.[j] = '#' && sample.IsNone then sample <- Some (i, j) yield if s.[j] = '#' then 1 else 0 ] ] let isAll0 ss = Array.map (fun s -> Array.sum s) ss |> Array.sum |> ((=) 0) let list2array (ss:int list list) : int [] [] = [| for i in 0 .. ss.Length - 1 do yield List.toArray ss.[i] |] if sample.IsNone then printfn "NO" else let h0 = fst sample.Value let w0 = snd sample.Value let result = seq { for dh in 0-h0 .. H-1-h0 do for dw in 0-w0 .. W-1-w0 do if dh <> 0 || dw <> 0 then let check = list2array S for h in 0 .. H-1 do for w in 0 .. W-1 do if h+dh >= 0 && h+dh < H && w+dw >= 0 && w+dw < W && check.[h].[w] = 1 && check.[h+dh].[w+dw] = 1 then check.[h].[w] <- 0 check.[h+dh].[w+dw] <- 0 yield if isAll0 check then "YES" else "NO" } match Seq.tryFind ((=) "YES") result with | Some(_) -> printfn "YES" | _ -> printfn "NO"