import java.util.Scanner; public class Nuriwake { public static void main(String[] args) { Scanner s = new Scanner(System.in); int H = s.nextInt(), W = s.nextInt(),count = 0; int[][][] color = new int[H][W][2]; for(int i = 0;i < H;i++){ String str = s.next(); for(int j = 0;j < W;j++){ if(str.charAt(j) == '#'){ color[i][j][0] = 1; //1は[0]なら黒、[1]なら青候補 count++; } } } s.close(); if(count%2 == 1||count == 0){ System.out.println("NO"); }else{ int redc = count / 2; for(int x = 0;x < W;x++){ for(int y = 0;y < H;y++){ int cp = 0,cn = 0; for(int i = 0;i < H;i++){ for(int j = 0;j < W-x;j++){ if(i+y=0&&color[i][j][0] == 1&&color[i-y][j+x][0] == 1&&color[i-y][j+x][1] == 0&&color[i][j][1] == 0){ color[i-y][j+x][1] =1; cn++; } } } for(int i = 0;i