Problem: One day Vasya got hold of a sheet of checkered paper n × m squares in size. Our Vasya adores geometrical figures, so he painted two rectangles on the paper. The rectangles' sides are parallel to the coordinates' axes, also the length of each side of each rectangle is no less than 3 squares and the sides are painted by the grid lines. The sides can also be part of the sheet of paper's edge. Then Vasya hatched all squares on the rectangles' frames.

Let's define a rectangle's frame as the set of squares inside the rectangle that share at least one side with its border.

A little later Vasya found a sheet of paper of exactly the same size and couldn't guess whether it is the same sheet of paper or a different one. So, he asked you to check whether the sheet of paper he had found contains two painted frames and nothing besides them.

Please note that the frames painted by Vasya can arbitrarily intersect, overlap or even completely coincide.

The coordinates on the sheet of paper are introduced in such a way that the X axis goes from top to bottom, the x coordinates of the squares' numbers take values from 1 to n and the Y axis goes from the left to the right and the y coordinates of the squares' numbers take values from 1 to m.

Input

The first input line contains two integers n and m (3 ≤ n, m ≤ 1000) — the sizes of the sheet of paper Vasya found. Next n lines, each consisting of m symbols "." (dot) and "#" (number sign), describe the found sheet of paper. The symbol "#" represents a hatched square and the symbol "." represents a non-hatched square.

Output

In the first line print the single word "YES" or "NO", meaning whether it is true that the found sheet of paper has two frames painted on it. If the answer is positive, then print in the second line 4 integers: the coordinates of the upper left and lower right corners of the first frame. In the third line print 4 integers: the coordinates of the upper left and the lower right corners of the second frame. If there are multiple answers, print any of them.

Examples

Input

4 5
#####
#.#.#
###.#
#####


Output

YES
1 1 3 3
1 1 4 5


Input

5 6
...###
...###
#####.
#...#.
#####.


Output

NO

Note

In the first sample there are two frames on the picture. The first one is:
    
    
    ###..  
    #.#..  
    ###..  
    .....  
    

The second one is:
    
    
    #####  
    #...#  
    #...#  
    #####  
    

In the second sample the painted figures are not frames. Note that the height and width of valid frames is no less than 3.

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

public class D {

	public D () throws IOException {
		N = sc.nextInt();
		M = sc.nextInt();
		C = new char [N][];
		for (int n = 0; n < N; ++n)
			C[n] = sc.next().toCharArray();
		for (int i = 0; i < 4; ++i)
			vcan[i] = new HashSet<Integer>();
		solve();
	}
	
	char DOT = '.', SIGN = '#';	
	char [][] C;
	int N, M, T;
	int [][] vmust = { { -1, -1},{ -1, -1},{ -1, -1},{ -1, -1} }; 
	@SuppressWarnings("unchecked")
	Set<Integer>[] vcan = new Set[4];
	
	public void solve () {
		start();

		/* Count points, classify vertices, test rows */
		int cnt5 = 0;
		for (int n = 0; n < N; ++n) {
			int cnt = 0, ch = 0;
			for (int m = 0; m < M; ++m)
				if (s(n,m)) {
					if ((++T) == 8000)
						no();
					if ((++cnt) == 5 && (++cnt5) == 5)
						no();
					if (s(n,m) != s(n,m-1) && (++ch) == 9)
						no();
					checkv(n,m);
				}
		}
		
		/* Test columns */
		cnt5 = 0;
		for (int m = 0; m < M; ++m) {
			int cnt = 0, ch = 0;
			for (int n = 0; n < N; ++n)
				if (s(n,m)) {
					++cnt;
					if ((++cnt) == 5 && (++cnt5) == 5)
						no();
					if (s(n,m) != s(n-1,m) && (++ch) == 9)
						no();
				}
		}
		
		/* Test vertices */
		for (int i1 = 0; i1 < 4; ++i1)
			for (int j1 = 0; j1 < 2; ++j1)
				for (int i2 = 0; i2 < 4; ++i2)
					for (int j2 = 0; j2 < 2; ++j2)
						if (i1 != i2 || j1 != j2)
							if (vmust[i1][j1] == vmust[i2][j2] && vmust[i1][j1] != -1)
								no();
		
		int [] R1 = new int [2], R2 = new int [2];
		R1[0] = vmust[0][0];
		
		Integer [] T2 = vmust[0][1] >= 0 ? new Integer [] { vmust[0][1] } : vcan[0].toArray(new Integer[0]);
		Integer [] B = vmust[3][1] >= 0 ? new Integer [] { vmust[3][1] } : vcan[3].toArray(new Integer[0]);
		
		for (int t2 : T2) {
			R2[0] = t2;

			/* Case 1 */
			R1[1] = vmust[3][0];
			for (int b2 : B) {
				if (b2 > t2) {
					R2[1] = b2;
					test(R1, R2);
				}
			}
			
			/* Case 2 */
			R2[1] = vmust[3][0];
			for (int b1 : B) {
				R1[1] = b1;
				test(R1, R2);
			}
		}
		
		no();
	}

	void no () {
		print("NO");
	}
	
	void test(int [] R1, int [] R2) {
		int [] p = ley(R1[0]), q = ley(R1[1]), r = ley(R2[0]), s = ley(R2[1]);
		int px = p[0], py = p[1], qx = q[0], qy = q[1], rx = r[0], ry = r[1], sx = s[0], sy = s[1];
		
		int trr1 = key(px,qy), trr2 = key(rx,sy), blr1 = key(qx,py), blr2 = key(sx,ry);
		
		boolean res = 
			vtest (trr1, trr2, vmust[1]) &&
			vtest (blr1, blr2, vmust[2]) &&
			t3(p,q) && t3(r,s);
		
		if(!res)
			return;
		
		int sz = (qx-px + qy-py + sx-rx + sy-ry) * 2;
		
		if (rx == px || rx == qx || sx == px || sx == qx) {
			int u = Math.max(py, ry), v = Math.min(qy, sy);
			int d = v-u+1;
			if (d > 0) {
				sz -= d;
				if (rx == px && sx == qx)
					sz -= d;
			}
		}		
		if (ry == py || ry == qy || sy == py || sy == qy) {
			int u = Math.max(px, rx), v = Math.min(qx, sx);
			int d = v-u+1;
			if (d > 0) {
				sz -= d;
				if (ry == py && sy == qy)
					sz -= d;
			}
		}		
		
		boolean L1 = rx > px && rx < qx, L2 = sx > px && sx < qx;
		if (L1 || L2) {
			int d = 0;
			if (py > ry && py < sy)
				++d;
			if (qy > ry && qy < sy)
				++d;
			sz -= d;
			if (L1 && L2)
				sz -= d;
		}
		boolean M1 = ry > py && ry < qy, M2 = sy > py && sy < qy;
		if (M1 || M2) {
			int d = 0;
			if (px > rx && px < sx)
				++d;
			if (qx > rx && qx < sx)
				++d;
			sz -= d;
			if (M1 && M2)
				sz -= d;
		}
		
		int [] Q = new int [] { R1[0], R1[1], R2[0], R2[1], trr1, trr2, blr1, blr2 };
		for (int i = 0; i < 8; ++i)
			for (int j = i+1; j < 8; ++j)
				if (Q[i] == Q[j])
					++sz;
		
		if (T != sz)
			return;
		
		if (rect(R1) && rect(R2)) {
			print2("YES");
			++px; ++py; ++qx; ++qy; ++rx; ++ry; ++sx; ++sy;
			print2(px + " " + py + " " + qx + " " + qy);
			print(rx + " " + ry + " " + sx + " " + sy);
		}
	}

	boolean rect(int [] R) {
		int [] p = ley(R[0]), q = ley(R[1]);
		int px = p[0], py = p[1], qx = q[0], qy = q[1];
		
		for (int x = px; x <= qx; ++x)
			if (!s(x, py) || !s(x, qy))
				return false;
		for (int y = py; y <= qy; ++y)
			if (!s(px, y) || !s(qx,y))
				return false;
		
		return true;
	}
	
	boolean t3(int [] p, int [] q) {
		return q[0]-p[0] > 1 && q[1]-p[1] > 1;
	}
	boolean vtest(int p, int q, int [] V) {
		for (int i = 0; i < V.length; ++i)
			if (p != V[i] && q != V[i] && V[i] >= 0)
				return false;
		return true;
	}
	
	void checkv(int x, int y) {
		for (int i = 0; i < 4; ++i)
			checkv(x, y, i);
	}
	
	void checkv(int x, int y, int p) {
		int dx = 1 - (p&2), dy = 1- 2*(p&1);
		boolean canv = s(x+dx,y) && s(x+2*dx,y), canh = s(x,y+dy) && s(x,y+2*dy); 
		boolean musvh = !s(x-dx,y) && !s(x,y-dy), canvh = canv && canh;
		
		if (musvh && !canvh)
			no();
		if (canvh)
			vcan[p].add(key(x,y));
		if (musvh)
			madd(x,y,p);
	}
	
	void madd (int x, int y, int p) {
		int z = key(x,y);
		if (vmust[p][0] >= 0) {
			if (vmust[p][1] >= 0)
				no();
			else
				vmust[p][1] = z; 
		} else
			vmust[p][0] = z;
	}
	
	int key(int x, int y) {
		return 1000 * x + y;
	}
	
	int [] ley(int z) {
		return new int [] { z/1000, z%1000 };
	}
	
	boolean s(int x, int y) {
		return x >= 0 && x < N && y >= 0 && y < M && C[x][y] == SIGN;
	}
	
	////////////////////////////////////////////////////////////////////////////////////

	static Scanner sc;
	static long t;
	
	static void print2 (Object o) {
		System.out.println(o);
	}
	
	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}
	
	static void run () throws IOException {
		sc = new Scanner(System.in);
		new D();
	}
	
	public static void main(String[] args) throws IOException {
		run();
	}
	
	static long millis() {
		return System.currentTimeMillis();
	}
	
	static void start() {
		t = millis();
	}
}