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;
int n, m, num;
char a[1005][1005];
int lmax[1005][1005], umax[1005][1005];
vector<int> r, c;
bool frame(int ux, int uy, int dx, int dy, bool b[][1005], int& cnt) {
  if (dx == ux + 1 || dy == uy + 1 || a[ux][dy] != '#' || lmax[ux][dy] > uy ||
      a[dx][uy] != '#' || umax[dx][uy] > ux || a[dx][dy] != '#' ||
      lmax[dx][dy] > uy || umax[dx][dy] > ux) {
    return false;
  }
  for (int j = uy; j <= dy; ++j) {
    if (!b[ux][j]) {
      ++cnt;
      b[ux][j] = true;
    }
    if (!b[dx][j]) {
      ++cnt;
      b[dx][j] = true;
    }
  }
  for (int i = ux; i <= dx; ++i) {
    if (!b[i][uy]) {
      ++cnt;
      b[i][uy] = true;
    }
    if (!b[i][dy]) {
      ++cnt;
      b[i][dy] = true;
    }
  }
  return true;
}
void reset(int ux, int uy, int dx, int dy, bool b[][1005]) {
  for (int j = uy; j <= dy; ++j) {
    b[ux][j] = false;
    b[dx][j] = false;
  }
  for (int i = ux; i <= dx; ++i) {
    b[i][uy] = false;
    b[i][dy] = false;
  }
}
bool gao() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", &a[i][1]);
  }
  for (int i = 1; i <= n; ++i) {
    int cnt = 0;
    bool f = false;
    for (int j = 1; j <= m; ++j) {
      if (a[i][j] == '#') {
        ++num;
        if (!cnt) {
          lmax[i][j] = j;
        } else {
          lmax[i][j] = lmax[i][j - 1];
        }
        if (++cnt >= 3) f = true;
      } else {
        cnt = 0;
      }
    }
    if (f) r.push_back(i);
  }
  if (r.size() > 4) {
    int t1 = r[r.size() - 1];
    int t2 = r[r.size() - 2];
    r.resize(2);
    r.push_back(t1);
    r.push_back(t2);
  }
  if (r.size() <= 1) return false;
  for (int j = 1; j <= m; ++j) {
    int cnt = 0;
    bool f = false;
    for (int i = 1; i <= n; ++i) {
      if (a[i][j] == '#') {
        if (!cnt) {
          umax[i][j] = i;
        } else {
          umax[i][j] = umax[i - 1][j];
        }
        if (++cnt >= 3) f = true;
      } else {
        cnt = 0;
      }
    }
    if (f) c.push_back(j);
  }
  if (c.size() > 4) {
    int t1 = c[c.size() - 1];
    int t2 = c[c.size() - 2];
    c.resize(2);
    c.push_back(t1);
    c.push_back(t2);
  }
  if (c.size() <= 1) return false;
  int p = r.size(), q = c.size();
  bool b[1005][1005] = {};
  int ui1, uj1, di1, dj1, ui2, uj2, di2, dj2;
  for (ui1 = 0; ui1 < p; ++ui1)
    for (di1 = ui1 + 1; di1 < p; ++di1)
      for (uj1 = 0; uj1 < q; ++uj1)
        for (dj1 = uj1 + 1; dj1 < q; ++dj1) {
          for (ui2 = 0; ui2 < p; ++ui2)
            for (di2 = ui2 + 1; di2 < p; ++di2)
              for (uj2 = 0; uj2 < q; ++uj2)
                for (dj2 = uj2 + 1; dj2 < q; ++dj2) {
                  int cnt = 0;
                  int ux1 = r[ui1], uy1 = c[uj1], dx1 = r[di1], dy1 = c[dj1];
                  int ux2 = r[ui2], uy2 = c[uj2], dx2 = r[di2], dy2 = c[dj2];
                  if (frame(ux1, uy1, dx1, dy1, b, cnt) &&
                      frame(ux2, uy2, dx2, dy2, b, cnt) && cnt == num) {
                    puts("YES");
                    printf("%d %d %d %d\n", ux1, uy1, dx1, dy1);
                    printf("%d %d %d %d\n", ux2, uy2, dx2, dy2);
                    return true;
                  }
                  reset(ux1, uy1, dx1, dy1, b);
                  reset(ux2, uy2, dx2, dy2, b);
                }
        }
  return false;
}
int main() {
  if (!gao()) puts("NO");
}