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.*;

/**
 * Codeforces Round #108 (Div. 2), D
 * @author Roman Kosenko <madkite@gmail.com>
 */
public class C152D_Frames {
	public static void main(String... args) throws IOException {
		long time = 0;
		if(args.length != 0) {
			System.setIn(new FileInputStream(args[0]));
			time = System.currentTimeMillis();
		} else if(!Boolean.parseBoolean(System.getProperty("ONLINE_JUDGE"))) {
			//main("in/C152D.1.txt");
			//main("in/C152D.2.txt");
			main("input.txt");
			return;
		}
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] ss = br.readLine().split(" ");
		int n = Integer.parseInt(ss[0]), m = Integer.parseInt(ss[1]);
		boolean a[][] = new boolean[n][m];
		for(int i = 0; i < n; i++) {
			String s = br.readLine();
			for(int j = 0; j < m; j++)
				a[i][j] = s.charAt(j) == '#';
		}

		int[][] result = solve(a);

		if(result == null)
			System.out.println("NO");
		else {
			System.out.println("YES");
			for(int i = 0; i < result[0].length; i++)
				result[0][i]++;
			if(result[0] != result[1]) {
				for(int i = 0; i < result[1].length; i++)
					result[1][i]++;
			}
			System.out.println(Arrays.toString(result[0]).replaceAll("[\\[\\],]", ""));
			System.out.println(Arrays.toString(result[1]).replaceAll("[\\[\\],]", ""));
		}

		/*
		List<int[]> c1 = new ArrayList<int[]>(n * m / 4);
		for(int i = 0; i < n - 1; i++) {
			for(int j = 0; j < m - 1; j++)
				if(a[i][j] && a[i + 1][j] && a[i][j + 1])
					c1.add(new int[]{i, j});
		}
		List<int[]> c2 = new ArrayList<int[]>(n * m / 4);
		for(int i = 1; i < n; i++) {
			for(int j = 1; j < m; j++)
				if(a[i][j] && a[i - 1][j] && a[i][j - 1])
					c2.add(new int[]{i, j});
		}

		if(!c1.isEmpty() && !c2.isEmpty()) {
			int l = Integer.MAX_VALUE, r = 0, t = Integer.MAX_VALUE, b = 0;
			for(int[] i : c1) {
				t = Math.min(t, i[0]);
				l = Math.min(l, i[1]);
			}
			for(int[] i : c2) {
				b = Math.max(b, i[0]);
				r = Math.max(r, i[1]);
			}
			//System.out.println(l + "x" + t + " " + r + "x" + b);
			boolean o = true, oo = true;
			int[] qx = new int[n], qy = new int[m];
			for(int i = 0; o && i < n; i++) {
				for(int j = 0; o && j < m; j++) {
					if(i > t && i < b && j > l && j < r) {
						if(a[i][j]) {
							qx[i]++;
							qy[j]++;
						} else
							oo = false;
					} else if((i == t || i == b) && j >= l && j <= r || (j == l || j == r) && i >= t && i <= b)
						o = a[i][j];
					else
						o = !a[i][j];
				}
			}
			//System.out.println(Arrays.toString(qx));
			//System.out.println(Arrays.toString(qy));
			if(o) {
				if(oo) {
					if(Math.min(r - l, b - t) == 3) {
						System.out.println("YES");
						if(r - l == 3) {
							System.out.println((t + 1) + " " + (l + 1) + " " + (b + 1) + " " + r);
							System.out.println((t + 1) + " " + (l + 2) + " " + (b + 1) + " " + (r + 1));
						} else {
							System.out.println((t + 1) + " " + (l + 1) + " " + b + " " + (r + 1));
							System.out.println((t + 2) + " " + (l + 1) + " " + (b + 1) + " " + (r + 1));
						}
					} else
						System.out.println("NO");
					return;
				} else {
					List<Integer> lx = new ArrayList<Integer>();
					for(int i = t + 1; i < b; i++)
						if(qx[i] == r - l - 1)
							lx.add(i);
					List<Integer> ly = new ArrayList<Integer>();
					for(int i = l + 1; i < r; i++)
						if(qy[i] == b - t - 1)
							ly.add(i);
					if(lx.size() == 2 && ly.isEmpty()) {
						System.out.println("YES");
						System.out.println((t + 1) + " " + (l + 1) + " " + (lx.get(1) + 1) + " " + (r + 1));
						System.out.println((lx.get(0) + 1) + " " + (l + 1) + " " + (b + 1) + " " + (r + 1));
						return;
					} else if(ly.size() == 2 && lx.isEmpty()) {
						System.out.println("YES");
						System.out.println((t + 1) + " " + (l + 1) + " " + (b + 1) + " " + (ly.get(1) + 1));
						System.out.println((t + 1) + " " + (ly.get(0) + 1) + " " + (b + 1) + " " + (r + 1));
						return;
					}
				}
			}
		}

		//int s = Math.max(18, Math.max(n, m));
		List<int[]> result = new ArrayList<int[]>(18);
		main: for(int[] a1 : c1) {
			loop: for(int[] a2 : c2) {
				if(a2[0] < a1[0] + 2 || a2[1] < a1[1] + 2)
					continue;
				for(int i = a1[0]; i <= a2[0]; i++)
					if(!a[i][a1[1]] || !a[i][a2[1]])
						continue loop;
				for(int i = a1[1]; i <= a2[1]; i++)
					if(!a[a1[0]][i] || !a[a2[0]][i])
						continue loop;
				//System.out.println(a1[0] + "x" + a1[1] + " " + a2[0] + "x" + a2[1]);
				if(result.size() == 18) {
					result.clear();
					break main;
				}
				result.add(new int[]{a1[0], a1[1], a2[0], a2[1]});
			}
		}

		if(result.isEmpty())
			System.out.println("NO");
		else {
			boolean b[][] = new boolean[n][m];
			for(int zi1 = 0; zi1 < result.size(); zi1++) {
				int[] z1 = result.get(zi1);
				loop: for(int zi2 = zi1; zi2 < result.size(); zi2++) {
					int[] z2 = result.get(zi2);
					for(int i = 0; i < n; i++)
						System.arraycopy(a[i], 0, b[i], 0, m);
					for(int i = z1[0]; i <= z1[2]; i++)
						b[i][z1[1]] = b[i][z1[3]] = false;
					for(int i = z1[1]; i <= z1[3]; i++)
						b[z1[0]][i] = b[z1[2]][i] = false;
					for(int i = z2[0]; i <= z2[2]; i++)
						b[i][z2[1]] = b[i][z2[3]] = false;
					for(int i = z2[1]; i <= z2[3]; i++)
						b[z2[0]][i] = b[z2[2]][i] = false;
					for(int i = 0; i < n; i++) {
						for(int j = 0; j < m; j++)
							if(b[i][j])
								continue loop;
					}
					System.out.println("YES");
					for(int i = 0; i < z1.length; i++)
						z1[i]++;
					if(z2 != z1) {
						for(int i = 0; i < z2.length; i++)
							z2[i]++;
					}
					System.out.println(Arrays.toString(z1).replaceAll("[\\[\\],]", ""));
					System.out.println(Arrays.toString(z2).replaceAll("[\\[\\],]", ""));
					return;
				}
			}
			System.out.println("NO");
		}
		*/

		if(time != 0)
			System.out.println(System.currentTimeMillis() - time);
	}

	private static int[][] solve(final boolean a[][]) {
		final int n = a.length, m = a[0].length;
		TreeSet<Integer> bx = new TreeSet<Integer>();
		for(int i = 0; i < n ; i++) {
			for(int j = 0; j < m - 2; j++)
				if(a[i][j] && a[i][j + 1] && a[i][j + 2])
					bx.add(i);
		}
		TreeSet<Integer> by = new TreeSet<Integer>();
		for(int j = 0; j < m; j++) {
			for(int i = 0; i < n - 2 ; i++)
				if(a[i][j] && a[i + 1][j] && a[i + 2][j])
					by.add(j);
		}
		if(bx.size() < 2 || by.size() < 2)
			return null;
		Iterator<Integer> it = bx.iterator();
		int bx1 = it.next(), bx2 = it.next(), bx3 = bx.size() > 2 ? it.next() : -1;
		it = by.iterator();
		int by1 = it.next(), by2 = it.next(), by3 = by.size() > 2 ? it.next() : -1;
		it = bx.descendingIterator();
		int bx6 = it.next(), bx5 = it.next(), bx4 = bx.size() > 2 ? it.next() : -1;
		it = by.descendingIterator();
		int by6 = it.next(), by5 = it.next(), by4 = by.size() > 2 ? it.next() : -1;
		//System.out.println(bx); System.out.println(by);

		List<int[]> c1 = new ArrayList<int[]>(n * m / 4);
		for(int i = 0; i < n - 1; i++) {
			for(int j = 0; j < m - 1; j++)
				if(a[i][j] && a[i + 1][j] && a[i][j + 1] && (bx1 == i || bx2 == i || bx3 == i) && (by1 == j || by2 == j || by3 == j))
					c1.add(new int[]{i, j});
		}
		List<int[]> c2 = new ArrayList<int[]>(n * m / 4);
		for(int i = 1; i < n; i++) {
			for(int j = 1; j < m; j++)
				if(a[i][j] && a[i - 1][j] && a[i][j - 1] && (bx6 == i || bx5 == i || bx4 == i) && (by6 == j || by5 == j || by4 == j))
					c2.add(new int[]{i, j});
		}

		List<int[]> r = new ArrayList<int[]>(18);
		for(int[] a1 : c1) {
			loop: for(int[] a2 : c2) {
				if(a2[0] < a1[0] + 2 || a2[1] < a1[1] + 2)
					continue;
				for(int i = a1[0]; i <= a2[0]; i++)
					if(!a[i][a1[1]] || !a[i][a2[1]])
						continue loop;
				for(int i = a1[1]; i <= a2[1]; i++)
					if(!a[a1[0]][i] || !a[a2[0]][i])
						continue loop;
				//System.out.println(a1[0] + "x" + a1[1] + " " + a2[0] + "x" + a2[1]);
				if(r.size() == 27)
					return null;
				r.add(new int[]{a1[0], a1[1], a2[0], a2[1]});
			}
		}

		boolean b[][] = new boolean[n][m];
		for(int i1 = 0; i1 < r.size(); i1++) {
			int[] r1 = r.get(i1);
			loop: for(int i2 = i1; i2 < r.size(); i2++) {
				int[] r2 = r.get(i2);
				for(int i = 0; i < n; i++)
					System.arraycopy(a[i], 0, b[i], 0, m);
				for(int i = r1[0]; i <= r1[2]; i++)
					b[i][r1[1]] = b[i][r1[3]] = false;
				for(int i = r1[1]; i <= r1[3]; i++)
					b[r1[0]][i] = b[r1[2]][i] = false;
				for(int i = r2[0]; i <= r2[2]; i++)
					b[i][r2[1]] = b[i][r2[3]] = false;
				for(int i = r2[1]; i <= r2[3]; i++)
					b[r2[0]][i] = b[r2[2]][i] = false;
				for(int i = 0; i < n; i++) {
					for(int j = 0; j < m; j++)
						if(b[i][j])
							continue loop;
				}
				return new int[][] {r1, r2};
			}
		}
		return null;
	}
}