import java.util.Scanner; public class Main_yukicoder179 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); int w = sc.nextInt(); char[][] s = new char[h][]; int black = 0; for (int i = 0; i < h; i++) { s[i] = sc.next().toCharArray(); for (int j = 0; j < s[i].length; j++) { if (s[i][j] == '#') { black++; } } } boolean flag = false; if (black != 0 && black % 2 == 0) { fin: for (int dx = - w + 1; dx <= w - 1; dx++) { for (int dy = - h + 1; dy <= h - 1; dy++) { int same = 0; boolean[][] used = new boolean[h][w]; next: for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (i + dy >= 0 && i + dy < h && j + dx >= 0 && j + dx < w) { if (s[i][j] == '#' && !used[i][j]) { if (s[i + dy][j + dx] == '#' && !used[i + dy][j + dx]) { used[i][j] = true; used[i + dy][j + dx] = true; same++; } else { same = 0; break next; } } } } } if (same == (black / 2)) { flag = true; // System.out.println(dx + " " + dy); break fin; } } } } if (flag) { System.out.println("YES"); } else { System.out.println("NO"); } sc.close(); } }