void run(){
		Scanner sc = new Scanner(System.in);
		h = sc.nextInt(); w = sc.nextInt(); N = sc.nextInt();
		char[][] m = new char[h][], t = new char[h][w];
		for(int i=0;i<h;i++)m[i]=sc.next().toCharArray();
		boolean ok = false;
		for(int i=0;i<h&&!ok;i++)for(int j=0;j<w-1&&!ok;j++){
			if(m[i][j]!=m[i][j+1]){
				for(int y=0;y<h;y++)for(int x=0;x<w;x++)t[y][x]=m[y][x];
				char x = t[i][j];
				t[i][j] = t[i][j+1]; t[i][j+1] = x;
				ok = f(t);
			}
		}
		System.out.println(ok?"YES":"NO");
	}