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 kMaxN = 1000, kMaxM = 1000;
int n, m;
char buf[kMaxN + 1][kMaxM + 1];
int row[kMaxN + 1][kMaxM + 1], col[kMaxN + 1][kMaxM + 1];
int dr[kMaxN + 1][kMaxM + 1], dc[kMaxN + 1][kMaxM + 1];
int r[kMaxN + 1], c[kMaxM + 1];
int rr[kMaxN + 1], cc[kMaxM + 1];
int sum;
bool C(int x0, int y0, int x1, int y1) {
  if (x1 - x0 + 1 < 3) return false;
  if (y1 - y0 + 1 < 3) return false;
  int a = x1 - x0 + 1, b = y1 - y0 + 1;
  return (row[x0][y1] - row[x0][y0 - 1] == b &&
          row[x1][y1] - row[x1][y0 - 1] == b &&
          col[x1][y0] - col[x0 - 1][y0] == a &&
          col[x1][y1] - col[x0 - 1][y1] == a);
}
void D(int x0, int y0, int x1, int y1) {
  for (int i = y0; i <= y1; ++i) {
    if (buf[x0][i] == '#') {
      --sum;
      buf[x0][i] = '.';
    }
    if (buf[x1][i] == '#') {
      --sum;
      buf[x1][i] = '.';
    }
  }
  for (int i = x0; i <= x1; ++i) {
    if (buf[i][y0] == '#') {
      --sum;
      buf[i][y0] = '.';
    }
    if (buf[i][y1] == '#') {
      --sum;
      buf[i][y1] = '.';
    }
  }
}
void E(int x0, int y0, int x1, int y1) {
  for (int i = y0; i <= y1; ++i) {
    if (buf[x0][i] != '#') {
      ++sum;
      buf[x0][i] = '#';
    }
    if (buf[x1][i] != '#') {
      ++sum;
      buf[x1][i] = '#';
    }
  }
  for (int i = x0; i <= x1; ++i) {
    if (buf[i][y0] != '#') {
      ++sum;
      buf[i][y0] = '#';
    }
    if (buf[i][y1] != '#') {
      ++sum;
      buf[i][y1] = '#';
    }
  }
}
void Check0() {
  if (rr[0] < 2 || cc[0] < 2) {
    puts("NO");
    return;
  }
  int x0 = rr[1], y0 = 1;
  while (buf[x0][cc[y0]] != '#') ++y0;
  y0 = cc[y0];
  for (int i = 2; i <= rr[0]; ++i)
    for (int j = 2; j <= cc[0]; ++j)
      if (C(x0, y0, rr[i], cc[j])) {
        for (int a = 1; a <= rr[0]; ++a)
          for (int b = 1; b <= cc[0]; ++b)
            for (int c = a + 1; c <= rr[0]; ++c)
              for (int d = b + 1; d <= cc[0]; ++d)
                if (C(rr[a], cc[b], rr[c], cc[d])) {
                  D(x0, y0, rr[i], cc[j]);
                  D(rr[a], cc[b], rr[c], cc[d]);
                  if (!sum) {
                    puts("YES");
                    printf("%d %d %d %d\n%d %d %d %d\n", x0, y0, rr[i], cc[j],
                           rr[a], cc[b], rr[c], cc[d]);
                    return;
                  }
                  E(rr[a], cc[b], rr[c], cc[d]);
                  E(x0, y0, rr[i], cc[j]);
                }
      }
  puts("NO");
}
void Check1() {
  if (rr[0] > 4 && cc[0] != 4) {
    puts("NO");
    return;
  }
  if (cc[0] > 4 && rr[0] != 4) {
    puts("NO");
    return;
  }
  if (rr[0] > 4) {
    int x0 = rr[1], x1 = rr[rr[0]];
    for (int a = 1; a <= 2; ++a)
      for (int b = rr[0] - 1; b <= rr[0]; ++b) {
        if (C(x0, cc[1], x1, cc[3]) && C(rr[a], cc[2], rr[b], cc[4])) {
          D(x0, cc[1], x1, cc[3]), D(rr[a], cc[2], rr[b], cc[4]);
          if (!sum) {
            puts("YES");
            printf("%d %d %d %d\n%d %d %d %d\n", x0, cc[1], x1, cc[3], rr[a],
                   cc[2], rr[b], cc[4]);
            return;
          }
          E(x0, cc[1], x1, cc[3]), E(rr[a], cc[2], rr[b], cc[4]);
        }
        if (C(x0, cc[2], x1, cc[4]) && C(rr[a], cc[1], rr[b], cc[3])) {
          D(x0, cc[2], x1, cc[4]), D(rr[a], cc[1], rr[b], cc[3]);
          if (!sum) {
            puts("YES");
            printf("%d %d %d %d\n%d %d %d %d\n", x0, cc[2], x1, cc[4], rr[a],
                   cc[1], rr[b], cc[3]);
            return;
          }
          E(x0, cc[2], x1, cc[4]), E(rr[a], cc[1], rr[b], cc[3]);
        }
      }
  } else {
    int y0 = cc[1], y1 = cc[cc[0]];
    for (int a = 1; a <= 2; ++a)
      for (int b = cc[0] - 1; b <= cc[0]; ++b) {
        if (C(rr[1], y0, rr[3], y1) && C(rr[2], cc[a], rr[4], cc[b])) {
          D(rr[1], y0, rr[3], y1), D(rr[2], cc[a], rr[4], cc[b]);
          if (!sum) {
            puts("YES");
            printf("%d %d %d %d\n%d %d %d %d\n", rr[1], y0, rr[3], y1, rr[2],
                   cc[a], rr[4], cc[b]);
            return;
          }
          E(rr[1], y0, rr[3], y1), E(rr[2], cc[a], rr[4], cc[b]);
        }
        if (C(rr[2], y0, rr[4], y1) && C(rr[1], cc[a], rr[3], cc[b])) {
          D(rr[2], y0, rr[4], y1), D(rr[1], cc[a], rr[3], cc[b]);
          if (!sum) {
            puts("YES");
            printf("%d %d %d %d\n%d %d %d %d\n", rr[2], y0, rr[4], y1, rr[1],
                   cc[a], rr[3], cc[b]);
            return;
          }
          E(rr[2], y0, rr[4], y1), E(rr[1], cc[a], rr[3], cc[b]);
        }
      }
  }
  puts("NO");
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", buf[i] + 1);
    for (int j = 1; j <= m; ++j) {
      row[i][j] = row[i][j - 1] + (buf[i][j] == '#');
      col[i][j] = col[i - 1][j] + (buf[i][j] == '#');
      if (buf[i][j] == '#') {
        ++sum;
        dr[i][j] = dr[i][j - 1] + 1;
        dc[i][j] = dc[i - 1][j] + 1;
        r[i] = max(r[i], dr[i][j]);
        c[j] = max(c[j], dc[i][j]);
      }
    }
  }
  for (int i = 1; i <= n; ++i)
    if (r[i] >= 3) rr[++rr[0]] = i;
  for (int j = 1; j <= m; ++j)
    if (c[j] >= 3) cc[++cc[0]] = j;
  if (rr[0] <= 4 && cc[0] <= 4)
    Check0();
  else
    Check1();
  return 0;
}