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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
char a[N][N];
int n, m, b[N], x[N], y[N];
int c[11], f[N][11], g[N][4];
int main() {
  int i, j, k, s, l, r, u, d, w, p;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i = i + 1) scanf("%s", a[i]);
  w = 0, p = 0;
  for (i = 0; i < n - 1; i = i + 1) {
    b[i] = 1;
    s = 0;
    for (j = 0; j < m; j = j + 1) {
      if (a[i][j] != a[i + 1][j]) b[i] = 0;
      if (a[i][j] == '#') s++;
    }
    l = 0;
    for (j = 0; j < m - 2; j = j + 1)
      if (a[i][j] == '#' && a[i][j + 1] == '#' && a[i][j + 2] == '#') l = 1;
    if (!b[i] && !s && !w) b[i] = 1, w = 1;
    if (b[i] && l) {
      if (p < 4) {
        b[i] = 0;
        p++;
      }
    } else
      p = 0;
  }
  b[n - 1] = 0;
  s = 0;
  for (j = 0; j < m; j = j + 1)
    if (a[n - 1][j] == '#') s++;
  if (!s) b[n - 1] = 1;
  k = 0;
  for (i = 0; i < n; i = i + 1) {
    if (b[i]) continue;
    for (j = 0; j < m; j = j + 1) a[k][j] = a[i][j];
    x[k++] = i + 1;
  }
  n = k;
  w = 0, p = 0;
  for (j = 0; j < m - 1; j = j + 1) {
    b[j] = 1;
    s = 0;
    for (i = 0; i < n; i = i + 1) {
      if (a[i][j] != a[i][j + 1]) b[j] = 0;
      if (a[i][j] == '#') s++;
    }
    l = 0;
    for (i = 0; i < n - 2; i = i + 1)
      if (a[i][j] == '#' && a[i + 1][j] == '#' && a[i + 2][j] == '#') l = 1;
    if (!b[j] && !s && !w) b[j] = 1, w = 1;
    if (b[j] && l) {
      if (p < 4) {
        b[j] = 0;
        p++;
      }
    } else
      p = 0;
  }
  b[m - 1] = 0;
  s = 0;
  for (i = 0; i < n; i = i + 1)
    if (a[i][m - 1] == '#') s++;
  if (!s) b[m - 1] = 1;
  k = 0;
  for (j = 0; j < m; j = j + 1) {
    if (b[j]) continue;
    for (i = 0; i < n; i = i + 1) a[i][k] = a[i][j];
    y[k++] = j + 1;
  }
  m = k;
  if (n > 9 || m > 9) {
    printf("NO");
    return 0;
  }
  for (i = 0; i < n; i = i + 1)
    for (j = 0; j < m; j = j + 1)
      if (a[i][j] == '#') c[i] |= (1 << j);
  k = 0;
  for (l = 0; l < m; l = l + 1)
    for (r = l + 2; r < m; r = r + 1)
      for (u = 0; u < n; u = u + 1)
        for (d = u + 2; d < n; d = d + 1) {
          for (i = u; i <= d; i = i + 1) f[k][i] |= (1 << l) | (1 << r);
          for (j = l; j <= r; j = j + 1)
            f[k][u] |= (1 << j), f[k][d] |= (1 << j);
          g[k][0] = x[u], g[k][1] = y[l];
          g[k][2] = x[d], g[k][3] = y[r];
          k++;
        }
  for (l = 0; l < k; l = l + 1)
    for (r = l; r < k; r = r + 1) {
      s = 1;
      for (i = 0; i < n; i = i + 1)
        if ((f[l][i] | f[r][i]) != c[i]) s = 0;
      if (s) {
        printf("YES\n");
        for (i = 0; i < 4; i = i + 1) printf("%d ", g[l][i]);
        printf("\n");
        for (i = 0; i < 4; i = i + 1) printf("%d ", g[r][i]);
        return 0;
      }
    }
  printf("NO");
  return 0;
}