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;
struct st {
  int l, r, x;
} X[1005], Y[1005];
const int D[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
int S, N, M, tot, b[1005][1005], q[105][2], U[1005], V[1005];
bool B[1005][1005], f[1005], g[1005];
char a[1005][1005];
void init() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) scanf("%s", a[i] + 1);
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) B[i][j] = a[i][j] == '#', S += B[i][j];
}
bool check(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
  if (x2 - x1 < 2 || y2 - y1 < 2 || x4 - x3 < 2 || y4 - y3 < 2) return 0;
  if (!B[x1][y1] || !B[x2][y2] || !B[x3][y3] || !B[x4][y4]) return 0;
  int s = 0;
  tot++;
  for (int i = x1; i <= x2; i++)
    if (!B[i][y1])
      return 0;
    else if (b[i][y1] != tot)
      b[i][y1] = tot, s++;
  for (int i = x1; i <= x2; i++)
    if (!B[i][y2])
      return 0;
    else if (b[i][y2] != tot)
      b[i][y2] = tot, s++;
  for (int i = x3; i <= x4; i++)
    if (!B[i][y3])
      return 0;
    else if (b[i][y3] != tot)
      b[i][y3] = tot, s++;
  for (int i = x3; i <= x4; i++)
    if (!B[i][y4])
      return 0;
    else if (b[i][y4] != tot)
      b[i][y4] = tot, s++;
  for (int i = y1; i <= y2; i++)
    if (!B[x1][i])
      return 0;
    else if (b[x1][i] != tot)
      b[x1][i] = tot, s++;
  for (int i = y1; i <= y2; i++)
    if (!B[x2][i])
      return 0;
    else if (b[x2][i] != tot)
      b[x2][i] = tot, s++;
  for (int i = y3; i <= y4; i++)
    if (!B[x3][i])
      return 0;
    else if (b[x3][i] != tot)
      b[x3][i] = tot, s++;
  for (int i = y3; i <= y4; i++)
    if (!B[x4][i])
      return 0;
    else if (b[x4][i] != tot)
      b[x4][i] = tot, s++;
  return s == S;
}
void doit() {
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++)
      if (B[i][j]) {
        int s = 0;
        for (int k = 0; k < 4; k++)
          if (B[i + D[k][0]][j + D[k][1]]) s++;
        if (s < 2) {
          puts("NO");
          return;
        }
      }
  int n = 0, m = 0, t = 0;
  for (int i = 1; i <= N; i++)
    for (int j = 1, k; j <= M; j++)
      if (B[i][j]) {
        for (k = j; k <= M && B[i][k]; k++)
          ;
        if (k - j >= 3) X[++n].x = i, X[n].l = j, X[n].r = k - 1;
        j = k - 1;
      }
  for (int i = 1; i <= M; i++)
    for (int j = 1, k; j <= N; j++)
      if (B[j][i]) {
        for (k = j; k <= N && B[k][i]; k++)
          ;
        if (k - j >= 3) Y[++m].x = i, Y[m].l = j, Y[m].r = k - 1;
        j = k - 1;
      }
  int xx = 0, yy = 0;
  for (int i = 1; i <= n; i++) U[++xx] = X[i].x;
  for (int i = 1; i <= m; i++) V[++yy] = Y[i].x;
  sort(U + 1, U + xx + 1), xx = unique(U + 1, U + xx + 1) - U - 1;
  sort(V + 1, V + yy + 1), yy = unique(V + 1, V + yy + 1) - V - 1;
  for (int i = 1; i <= n; i++)
    if (X[i].x == U[1] || X[i].x == U[2] || X[i].x == U[xx] ||
        X[i].x == U[xx - 1])
      f[X[i].x] = g[X[i].l] = g[X[i].r] = 1;
  for (int i = 1; i <= m; i++)
    if (Y[i].x == V[1] || Y[i].x == V[2] || Y[i].x == V[yy] ||
        Y[i].x == V[yy - 1])
      f[Y[i].l] = f[Y[i].r] = g[Y[i].x] = 1;
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++)
      if (f[i] && g[j]) q[++t][0] = i, q[t][1] = j;
  for (int i = 1; i <= t; i++)
    for (int j = i + 1; j <= t; j++)
      for (int k = 1; k <= t; k++)
        for (int l = k + 1; l <= t; l++)
          if (check(q[i][0], q[i][1], q[j][0], q[j][1], q[k][0], q[k][1],
                    q[l][0], q[l][1])) {
            puts("YES");
            printf("%d %d %d %d\n%d %d %d %d\n", q[i][0], q[i][1], q[j][0],
                   q[j][1], q[k][0], q[k][1], q[l][0], q[l][1]);
            return;
          }
  puts("NO");
}
int main() {
  init();
  doit();
  return 0;
}