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 pp = 0; // 1が黒、2が青、3が赤 for(int s = 0; s < w; s++) { for(int t = 0; t < h; t++) { int[] g = grid; int p = 0; int c = 0; 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; if(g[b] == 1) { g[b] = 3; } else { p++; } } else { g[a] = 3; if(g[b] == 1) { g[b] = 2; } else { p++; } } c = 1 - c; } else { p++; } } } } if(p == 0) pp++; } } String ans = "NO"; if(pp > 0) ans = "YES"; System.out.println(ans); } }