import java.awt.Point; import java.io.FileInputStream; import java.io.PrintStream; import java.util.ArrayList; import java.util.Scanner; public class Main { static int h, w; static int[][] map; static int count; static void start() { for(int dy = 0;dy < h;dy++) for(int dx = 0;dx < w;dx++) { if(dx == 0 && dy == 0) continue; int[][] mapp = new int[h][w]; int cc = 0; for(int y = 0;y < h;y++) for(int x= 0;x < w;x++) mapp[y][x] = 0; for(int y = 0;y < (h-dy);y++) for(int x = 0;x < (w-dx);x++) { if(mapp[y][x] == 1) continue; if(map[y][x] == 0) continue; if(map[y+dy][x+dx] == 0) continue; mapp[y][x] = 1; mapp[y+dy][x+dx] = 1; cc += 2; if(cc == count) { System.out.println("YES"); return; } } cc = 0; for(int y = 0;y < h;y++) for(int x= 0;x < w;x++) mapp[y][x] = 0; for(int y = h-1;y >= dy;y--) for(int x = 0;x < (w-dx);x++) { if(mapp[y][x] == 1) continue; if(map[y][x] == 0) continue; if(map[y-dy][x+dx] == 0) continue; mapp[y][x] = 1; mapp[y-dy][x+dx] = 1; cc += 2; if(cc == count) { System.out.println("YES"); return; } } } System.out.println("NO"); } public static void main(String[] args) { Scanner sca = new Scanner(System.in); while(true) { h = sca.nextInt(); w = sca.nextInt(); map = new int[h][w]; count = 0; for(int y = 0;y < h;y++) { String str = sca.next(); for(int x = 0;x < w;x++) { if(str.charAt(x) == '#') { map[y][x] = 1; count++; } else { map[y][x] = 0; } } } start(); break; } } }