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 INF = 0x3f3f3f3f;
const long long int INFLL = 0x3f3f3f3f3f3f3f3fll;
long long int getint() {
  long long int ret = 0;
  bool f = 0;
  char c;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') f ^= 1;
  while (c >= '0' && c <= '9') {
    ret = ret * 10 + c - '0';
    c = getchar();
  }
  return f ? -ret : ret;
}
using namespace std;
const int MAXN = 1000;
char s[MAXN + 10];
bool vis[MAXN + 10][MAXN + 10];
bool hav[MAXN + 10][MAXN + 10];
int row[MAXN + 10], col[MAXN + 10], n, m, cnt1, cnt2;
bool judgerow(int p) {
  for (int i = 1; i <= m; ++i)
    if (vis[p][i] && vis[p][i + 1] && vis[p][i + 2]) return 1;
  return 0;
}
bool judgecol(int p) {
  for (int i = 1; i <= n; ++i)
    if (vis[i][p] && vis[i + 1][p] && vis[i + 2][p]) return 1;
  return 0;
}
int main() {
  n = getint(), m = getint();
  int num = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%s", s + 1);
    for (int j = 1; j <= m; ++j) num += vis[i][j] = s[j] == '#';
  }
  for (int i = 1; i <= n; ++i)
    if (judgerow(i)) row[++cnt1] = i;
  for (int i = 1; i <= m; ++i)
    if (judgecol(i)) col[++cnt2] = i;
  if (cnt1 > 4) {
    row[3] = row[cnt1 - 1];
    row[4] = row[cnt1];
    cnt1 = 4;
  }
  if (cnt2 > 4) {
    col[3] = col[cnt2 - 1];
    col[4] = col[cnt2];
    cnt2 = 4;
  }
  int rowi1, rowj1, rowi3, rowj3, i;
  int coli2, colj2, coli4, colj4;
  for (int i1 = 1; i1 <= cnt1; ++i1)
    for (int j1 = i1 + 1; j1 <= cnt1; ++j1)
      if (row[j1] - row[i1] >= 2)
        for (int i2 = 1; i2 <= cnt2; ++i2)
          for (int j2 = i2 + 1; j2 <= cnt2; ++j2)
            if (col[j2] - col[i2] >= 2)
              for (int i3 = 1; i3 <= cnt1; ++i3)
                for (int j3 = i3 + 1; j3 <= cnt1; ++j3)
                  if (row[j3] - row[i3] >= 2)
                    for (int i4 = 1; i4 <= cnt2; ++i4)
                      for (int j4 = i4 + 1; j4 <= cnt2; ++j4)
                        if (col[j4] - col[i4] >= 2) {
                          bool flag = 1;
                          int bit = 0;
                          rowi1 = row[i1];
                          rowj1 = row[j1];
                          rowi3 = row[i3];
                          rowj3 = row[j3];
                          coli2 = col[i2];
                          colj2 = col[j2];
                          coli4 = col[i4];
                          colj4 = col[j4];
                          for (i = coli2; flag && i <= colj2; ++i)
                            if (!vis[rowi1][i])
                              flag = 0;
                            else if (!hav[rowi1][i])
                              hav[rowi1][i] = 1, ++bit;
                          for (i = coli2; flag && i <= colj2; ++i)
                            if (!vis[rowj1][i])
                              flag = 0;
                            else if (!hav[rowj1][i])
                              hav[rowj1][i] = 1, ++bit;
                          for (i = coli4; flag && i <= colj4; ++i)
                            if (!vis[rowi3][i])
                              flag = 0;
                            else if (!hav[rowi3][i])
                              hav[rowi3][i] = 1, ++bit;
                          for (i = coli4; flag && i <= colj4; ++i)
                            if (!vis[rowj3][i])
                              flag = 0;
                            else if (!hav[rowj3][i])
                              hav[rowj3][i] = 1, ++bit;
                          for (i = rowi1; flag && i <= rowj1; ++i)
                            if (!vis[i][coli2])
                              flag = 0;
                            else if (!hav[i][coli2])
                              hav[i][coli2] = 1, ++bit;
                          for (i = rowi1; flag && i <= rowj1; ++i)
                            if (!vis[i][colj2])
                              flag = 0;
                            else if (!hav[i][colj2])
                              hav[i][colj2] = 1, ++bit;
                          for (i = rowi3; flag && i <= rowj3; ++i)
                            if (!vis[i][coli4])
                              flag = 0;
                            else if (!hav[i][coli4])
                              hav[i][coli4] = 1, ++bit;
                          for (i = rowi3; flag && i <= rowj3; ++i)
                            if (!vis[i][colj4])
                              flag = 0;
                            else if (!hav[i][colj4])
                              hav[i][colj4] = 1, ++bit;
                          if (flag && bit == num) {
                            printf("YES\n");
                            printf("%d %d %d %d\n", rowi1, coli2, rowj1, colj2);
                            printf("%d %d %d %d\n", rowi3, coli4, rowj3, colj4);
                            return 0;
                          }
                          for (i = coli2; i <= colj2; ++i) hav[rowi1][i] = 0;
                          for (i = coli2; i <= colj2; ++i) hav[rowj1][i] = 0;
                          for (i = coli4; i <= colj4; ++i) hav[rowi3][i] = 0;
                          for (i = coli4; i <= colj4; ++i) hav[rowj3][i] = 0;
                          for (i = rowi1; i <= rowj1; ++i) hav[i][coli2] = 0;
                          for (i = rowi1; i <= rowj1; ++i) hav[i][colj2] = 0;
                          for (i = rowi3; i <= rowj3; ++i) hav[i][coli4] = 0;
                          for (i = rowi3; i <= rowj3; ++i) hav[i][colj4] = 0;
                        }
  printf("NO\n");
  return 0;
}