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 kSelMax = 6;
pair<int, int> a[kSelMax + 10], b[kSelMax + 10];
int n, m, na, nb, tot;
int tag[1005][1005];
char bd[1005][1005];
int disX[1005 * 1005], disY[1005 * 1005], nDisX, nDisY;
void output(int i1, int j1, int i2, int j2) {
  puts("YES");
  printf("%d %d %d %d\n", a[i1].first, a[i1].second, b[j1].first, b[j1].second);
  printf("%d %d %d %d\n", a[i2].first, a[i2].second, b[j2].first, b[j2].second);
}
bool check(int i1, int j1, int i2, int j2) {
  if (!(b[j1].first - a[i1].first >= 2 && b[j1].second - a[i1].second >= 2 &&
        b[j2].first - a[i2].first >= 2 && b[j2].second - a[i2].second >= 2))
    return false;
  static int stamp = 0;
  stamp++;
  int cnt = 0;
  for (int x = a[i1].first; x <= b[j1].first; x++) {
    if (bd[x][a[i1].second] != '#')
      return false;
    else if (tag[x][a[i1].second] != stamp) {
      tag[x][a[i1].second] = stamp;
      cnt++;
    };
    if (bd[x][b[j1].second] != '#')
      return false;
    else if (tag[x][b[j1].second] != stamp) {
      tag[x][b[j1].second] = stamp;
      cnt++;
    };
  }
  for (int y = a[i1].second; y <= b[j1].second; y++) {
    if (bd[a[i1].first][y] != '#')
      return false;
    else if (tag[a[i1].first][y] != stamp) {
      tag[a[i1].first][y] = stamp;
      cnt++;
    };
    if (bd[b[j1].first][y] != '#')
      return false;
    else if (tag[b[j1].first][y] != stamp) {
      tag[b[j1].first][y] = stamp;
      cnt++;
    };
  }
  for (int x = a[i2].first; x <= b[j2].first; x++) {
    if (bd[x][a[i2].second] != '#')
      return false;
    else if (tag[x][a[i2].second] != stamp) {
      tag[x][a[i2].second] = stamp;
      cnt++;
    };
    if (bd[x][b[j2].second] != '#')
      return false;
    else if (tag[x][b[j2].second] != stamp) {
      tag[x][b[j2].second] = stamp;
      cnt++;
    };
  }
  for (int y = a[i2].second; y <= b[j2].second; y++) {
    if (bd[a[i2].first][y] != '#')
      return false;
    else if (tag[a[i2].first][y] != stamp) {
      tag[a[i2].first][y] = stamp;
      cnt++;
    };
    if (bd[b[j2].first][y] != '#')
      return false;
    else if (tag[b[j2].first][y] != stamp) {
      tag[b[j2].first][y] = stamp;
      cnt++;
    };
  }
  if (cnt == tot) {
    output(i1, j1, i2, j2);
    exit(0);
  }
  return false;
}
void crazyCheck(int x1, int x2, int x3, int x4, int y1, int y2, int y3,
                int y4) {
  int valX[4], valY[4];
  valX[0] = x1;
  valX[1] = x2;
  valX[2] = x3;
  valX[3] = x4;
  valY[0] = y1;
  valY[1] = y2;
  valY[2] = y3;
  valY[3] = y4;
  for (int s = 0, lim = (1 << 16); s < lim; s++) {
    a[na] = make_pair(valX[(((s) >> (2 * (0))) & 3)],
                      valY[(((s) >> (2 * (1))) & 3)]);
    b[nb] = make_pair(valX[(((s) >> (2 * (2))) & 3)],
                      valY[(((s) >> (2 * (3))) & 3)]);
    a[na + 1] = make_pair(valX[(((s) >> (2 * (4))) & 3)],
                          valY[(((s) >> (2 * (5))) & 3)]);
    b[nb + 1] = make_pair(valX[(((s) >> (2 * (6))) & 3)],
                          valY[(((s) >> (2 * (7))) & 3)]);
    check(na, nb, na + 1, nb + 1);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", bd[i] + 1);
    for (int j = 1; j <= m; j++) tot += bd[i][j] == '#';
  }
  for (int i = 3; nb < kSelMax && i <= n; i++)
    for (int j = 3; nb < kSelMax && j <= m; j++)
      if (bd[i][j] == '#' && bd[i - 1][j] == '#' && bd[i - 2][j] == '#' &&
          bd[i][j - 1] == '#' && bd[i][j - 2] == '#')
        b[nb++] = make_pair(i, j);
  for (int i = 1; na < kSelMax && i <= n - 2; i++)
    for (int j = 1; na < kSelMax && j <= m - 2; j++)
      if (bd[i][j] == '#' && bd[i + 1][j] == '#' && bd[i + 2][j] == '#' &&
          bd[i][j + 1] == '#' && bd[i][j + 2] == '#')
        a[na++] = make_pair(i, j);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (i >= 3 && bd[i][j] == '#' && bd[i - 1][j] == '#' &&
          bd[i - 2][j] == '#')
        disY[nDisY++] = j;
      if (j >= 3 && bd[i][j] == '#' && bd[i][j - 1] == '#' &&
          bd[i][j - 2] == '#')
        disX[nDisX++] = i;
    }
  sort(disX, disX + nDisX);
  nDisX = unique(disX, disX + nDisX) - disX;
  sort(disY, disY + nDisY);
  nDisY = unique(disY, disY + nDisY) - disY;
  if (nDisX >= 4 && nDisY >= 4)
    crazyCheck(disX[0], disX[1], disX[nDisX - 2], disX[nDisX - 1], disY[0],
               disY[1], disY[nDisY - 2], disY[nDisY - 1]);
  if (max(na, nb) >= kSelMax) {
    printf("NO\n");
    return 0;
  }
  for (int i1 = 0; i1 < na; i1++)
    for (int i2 = 0; i2 < na; i2++)
      for (int j1 = 0; j1 < nb; j1++)
        for (int j2 = 0; j2 < nb; j2++) {
          check(i1, j1, i2, j2);
        }
  printf("NO\n");
  return 0;
}