import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); int w = sc.nextInt(); int[] grid = new int[h * w]; for(int i = 0; i < h; i++) { String s = sc.next(); for(int j = 0; j < w; j++) { if(s.charAt(j) == '#') { grid[w * i + j] = 1; } } } int p = 0; int c = 0; // 1が黒、2が青、3が赤 for(int s = 0; s < w; s++) { for(int t = 0; t < h; t++) { int[] g = grid; for(int i = 0; i < h; i++) { for(int j = 0; j < w; j++) { int a = i * w + j; if(g[a] == 1) { if(((j + s) < w) && ((i + t) < h)) { int b = (i + t) * w + (j + s); if(c == 0) { g[a] = 2; g[b] = 3; } else { g[a] = 3; g[b] = 2; } c = 1 - c; } else { p++; } } } } } } String ans = "YES"; if(p == 0) ans = "NO"; System.out.println(ans); } }