import java.util.Scanner; public class No179 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = Integer.parseInt(sc.next()); int w = Integer.parseInt(sc.next()); String s; int first = 0, trans = 0, diff = 0, count = 0, check = 0; boolean[] b = new boolean[h*w]; for (int i = 0; i < h; i++) { s = sc.next(); for (int j = 0; j < w; j++) { if(s.charAt(j) == '#'){ b[i*w+j] = true; count++; } } } if(count % 2 == 1){ System.out.println("NO"); return; } count /= 2; for (int i = 0; i < h * w; i++) { if(b[i]){ first = i; break; } } for (int i = first + 1; i < h * w; i++) { if(b[i]){ trans = i; diff = trans - first; check = 0; for (int j = first + 1; j < h * w; j++) { if(b[j] && j != trans){ if(j+diff >= h*w || !b[j+diff]){ break; } check++; } if(check == count / 2){ System.out.println("YES"); return; } } } } System.out.println("NO"); return; } }