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>
const int N = 1010;
int n, m, sum = 0, tsum, sl = 0, sr = 0, f[N][N], tmp[N][N];
struct data {
  int d, x, y;
} l[7], r[7];
void print(int l1, int l2, int r1, int r2, int w) {
  for (int i = r[r1].d; i <= r[r2].d; i++) {
    if (w == 1) {
      if (tmp[l[l1].d][i] != 1) tsum++;
      if (tmp[l[l2].d][i] != 1) tsum++;
    }
    tmp[l[l1].d][i] = w;
    tmp[l[l2].d][i] = w;
  }
  for (int i = l[l1].d; i <= l[l2].d; i++) {
    if (w == 1) {
      if (tmp[i][r[r1].d] != 1) tsum++;
      if (tmp[i][r[r2].d] != 1) tsum++;
    }
    tmp[i][r[r1].d] = w;
    tmp[i][r[r2].d] = w;
  }
}
bool check(int l1, int l2, int r1, int r2, int l3, int l4, int r3, int r4) {
  if (l[l2].d - l[l1].d < 2 || r[r2].d - r[r1].d < 2 || l[l4].d - l[l3].d < 2 ||
      r[r4].d - r[r3].d < 2)
    return (false);
  for (int i = 1; i <= sl; i++)
    if (l1 != i && l2 != i && l3 != i && l4 != i) return (false);
  for (int i = 1; i <= sr; i++)
    if (r1 != i && r2 != i && r3 != i && r4 != i) return (false);
  if (l[l1].d < r[r1].x || l[l1].d < r[r2].x || l[l2].d > r[r1].y ||
      l[l2].d > r[r2].y || r[r1].d < l[l1].x || r[r1].d < l[l2].x ||
      r[r2].d > l[l1].y || r[r2].d > l[l2].y)
    return (false);
  if (l[l3].d < r[r3].x || l[l3].d < r[r4].x || l[l4].d > r[r3].y ||
      l[l4].d > r[r4].y || r[r3].d < l[l3].x || r[r3].d < l[l4].x ||
      r[r4].d > l[l3].y || r[r4].d > l[l4].y)
    return (false);
  tsum = 0;
  print(l1, l2, r1, r2, 1);
  print(l3, l4, r3, r4, 1);
  if (tsum != sum) {
    print(l1, l2, r1, r2, 0);
    print(l3, l4, r3, r4, 0);
    return (false);
  }
  printf("YES\n");
  printf("%d %d %d %d\n", l[l1].d, r[r1].d, l[l2].d, r[r2].d);
  printf("%d %d %d %d\n", l[l3].d, r[r3].d, l[l4].d, r[r4].d);
  return (true);
}
int main() {
  int s, i, j, k, o, p, q, w, x;
  char temp;
  bool cc;
  scanf("%d %d", &n, &m);
  memset(f, 0, sizeof(f));
  memset(tmp, 0, sizeof(tmp));
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) {
      do scanf("%c", &temp);
      while (temp != '.' && temp != '#');
      if (temp == '#') {
        f[i][j] = 1;
        sum++;
      }
    }
  for (i = 1; i <= n; i++) {
    s = 0;
    for (j = 1; j <= m + 1; j++)
      if (f[i][j] == 0) {
        if (s >= 3) {
          sl++;
          l[sl].d = i;
          l[sl].x = j - s;
          l[sl].y = j - 1;
        }
        if (sl > 4) break;
        s = 0;
      } else
        s++;
    if (sl > 4) break;
  }
  for (i = 1; i <= m; i++) {
    s = 0;
    for (j = 1; j <= n + 1; j++)
      if (f[j][i] == 0) {
        if (s >= 3) {
          sr++;
          r[sr].d = i;
          r[sr].x = j - s;
          r[sr].y = j - 1;
        }
        if (sr > 4) break;
        s = 0;
      } else
        s++;
    if (sr > 4) break;
  }
  if (sl == 4) {
    cc = true;
    if (l[2].d + 1 == l[3].d &&
        (l[1].d + 1 == l[2].d || l[3].d + 1 == l[4].d)) {
      for (i = l[1].x; i <= l[1].y; i++) {
        tmp[l[1].d][i] = 1;
        tmp[l[3].d][i] = 1;
      }
      for (i = l[1].d; i <= l[3].d; i++) {
        tmp[i][l[1].x] = 1;
        tmp[i][l[1].y] = 1;
      }
      for (i = l[4].x; i <= l[4].y; i++) {
        tmp[l[2].d][i] = 1;
        tmp[l[4].d][i] = 1;
      }
      for (i = l[2].d; i <= l[4].d; i++) {
        tmp[i][l[4].x] = 1;
        tmp[i][l[4].y] = 1;
      }
      for (i = 1; i <= n; i++)
        for (j = 1; j <= m; j++)
          if (tmp[i][j] != f[i][j]) {
            cc = false;
            break;
          }
      if (cc) {
        printf("YES\n");
        printf("%d %d %d %d\n", l[1].d, l[1].x, l[3].d, l[1].y);
        printf("%d %d %d %d", l[2].d, l[4].x, l[4].d, l[4].y);
        return (0);
      }
    }
  }
  if (sr == 4) {
    cc = true;
    if (r[2].d + 1 == r[3].d &&
        (r[1].d + 1 == r[2].d || r[3].d + 1 == r[4].d)) {
      for (i = r[1].x; i <= r[1].y; i++) {
        tmp[i][r[1].d] = 1;
        tmp[i][r[3].d] = 1;
      }
      for (i = r[1].d; i <= r[3].d; i++) {
        tmp[r[1].x][i] = 1;
        tmp[r[1].y][i] = 1;
      }
      for (i = r[4].x; i <= r[4].y; i++) {
        tmp[i][r[2].d] = 1;
        tmp[i][r[4].d] = 1;
      }
      for (i = r[2].d; i <= r[4].d; i++) {
        tmp[r[4].x][i] = 1;
        tmp[r[4].y][i] = 1;
      }
      for (i = 1; i <= n; i++)
        for (j = 1; j <= m; j++)
          if (tmp[i][j] != f[i][j]) {
            cc = false;
            break;
          }
      if (cc) {
        printf("YES\n");
        printf("%d %d %d %d\n", r[1].x, r[1].d, r[1].y, r[3].d);
        printf("%d %d %d %d", r[4].x, r[2].d, r[4].y, r[4].d);
        return (0);
      }
    }
  }
  if (sl > 4 || sr > 4) {
    printf("NO");
    return (0);
  }
  for (i = 1; i < sl; i++)
    for (j = i + 1; j <= sl; j++)
      for (k = 1; k < sr; k++)
        for (o = k + 1; o <= sr; o++)
          for (p = 1; p < sl; p++)
            for (q = p + 1; q <= sl; q++)
              for (w = 1; w < sr; w++)
                for (x = w + 1; x <= sr; x++)
                  if (check(i, j, k, o, p, q, w, x)) return (0);
  printf("NO");
  return (0);
}