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 MAXN = 1010;
char g[MAXN][MAXN];
bool vis[MAXN][MAXN];
int N, M;
map<pair<pair<pair<int, int>, pair<int, int> >,
         pair<pair<int, int>, pair<int, int> > >,
    bool>
    mp;
inline bool check(pair<int, int> a, pair<int, int> b, pair<int, int> c,
                  pair<int, int> d) {
  if (a.first > b.first) swap(a.first, b.first);
  if (a.second > b.second) swap(a.second, b.second);
  if (c.first > d.first) swap(c.first, d.first);
  if (c.second > d.second) swap(c.second, d.second);
  if (mp[make_pair(make_pair(a, b), make_pair(c, d))]) return false;
  mp[make_pair(make_pair(a, b), make_pair(c, d))] = true;
  if (b.first - a.first + 1 < 3 || b.second - a.second + 1 < 3) return false;
  if (d.first - c.first + 1 < 3 || d.second - c.second + 1 < 3) return false;
  memset(vis, 0, sizeof vis);
  for (int i = a.first; i <= b.first; i++)
    vis[i][a.second] = vis[i][b.second] = true;
  for (int j = a.second; j <= b.second; j++)
    vis[a.first][j] = vis[b.first][j] = true;
  for (int i = c.first; i <= d.first; i++)
    vis[i][c.second] = vis[i][d.second] = true;
  for (int j = c.second; j <= d.second; j++)
    vis[c.first][j] = vis[d.first][j] = true;
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++)
      if ((g[i][j] == '#') ^ vis[i][j]) return false;
  puts("YES");
  printf("%d %d %d %d\n", a.first, a.second, b.first, b.second);
  printf("%d %d %d %d\n", c.first, c.second, d.first, d.second);
  return true;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) scanf("%s", g[i] + 1);
  int x1 = 0, x2 = 0;
  for (int i = 1; i <= N; i++) {
    int cnt = 0;
    for (int j = 1; j <= M; j++) {
      if (g[i][j] == '#')
        cnt++;
      else
        cnt = 0;
      if (cnt >= 3) {
        x1 = i;
        break;
      }
    }
    if (x1) break;
  }
  for (int i = x1 + 1; i <= N; i++) {
    int cnt = 0;
    for (int j = 1; j <= M; j++) {
      if (g[i][j] == '#')
        cnt++;
      else
        cnt = 0;
      if (cnt >= 3) {
        x2 = i;
        break;
      }
    }
    if (x2) break;
  }
  if (!x2) x2 = x1;
  int y1 = 0, y2 = 0;
  for (int i = 1; i <= M; i++) {
    int cnt = 0;
    for (int j = 1; j <= N; j++) {
      if (g[j][i] == '#')
        cnt++;
      else
        cnt = 0;
      if (cnt >= 3) {
        y1 = i;
        break;
      }
    }
    if (y1) break;
  }
  for (int i = y1 + 1; i <= M; i++) {
    int cnt = 0;
    for (int j = 1; j <= N; j++) {
      if (g[j][i] == '#')
        cnt++;
      else
        cnt = 0;
      if (cnt >= 3) {
        y2 = i;
        break;
      }
    }
    if (y2) break;
  }
  if (!y2) y2 = y1;
  int x3 = 0, x4 = 0;
  for (int i = N; i >= 1; i--) {
    int cnt = 0;
    for (int j = 1; j <= M; j++) {
      if (g[i][j] == '#')
        cnt++;
      else
        cnt = 0;
      if (cnt >= 3) {
        x3 = i;
        break;
      }
    }
    if (x3) break;
  }
  for (int i = x3 - 1; i > 0; i--) {
    int cnt = 0;
    for (int j = 1; j <= M; j++) {
      if (g[i][j] == '#')
        cnt++;
      else
        cnt = 0;
      if (cnt >= 3) {
        x4 = i;
        break;
      }
    }
    if (x4) break;
  }
  if (!x4) x4 = x3;
  int y3 = 0, y4 = 0;
  for (int i = M; i > 0; i--) {
    int cnt = 0;
    for (int j = 1; j <= N; j++) {
      if (g[j][i] == '#')
        cnt++;
      else
        cnt = 0;
      if (cnt >= 3) {
        y3 = i;
        break;
      }
    }
    if (y3) break;
  }
  for (int i = y3 - 1; i > 0; i--) {
    int cnt = 0;
    for (int j = 1; j <= N; j++) {
      if (g[j][i] == '#')
        cnt++;
      else
        cnt = 0;
      if (cnt >= 3) {
        y4 = i;
        break;
      }
    }
    if (y4) break;
  }
  if (!y4) y4 = y3;
  int X[4], Y[4];
  X[0] = x1, X[1] = x2, X[2] = x3, X[3] = x4;
  Y[0] = y1, Y[1] = y2, Y[2] = y3, Y[3] = y4;
  for (int p1 = 0; p1 < 4; p1++)
    for (int p2 = 0; p2 < 4; p2++)
      for (int p3 = 0; p3 < 4; p3++)
        for (int p4 = 0; p4 < 4; p4++)
          for (int p5 = 0; p5 < 4; p5++)
            for (int p6 = 0; p6 < 4; p6++)
              for (int p7 = 0; p7 < 4; p7++)
                for (int p8 = 0; p8 < 4; p8++) {
                  pair<int, int> pp1(X[p1], Y[p5]);
                  pair<int, int> pp2(X[p2], Y[p6]);
                  pair<int, int> pp3(X[p3], Y[p7]);
                  pair<int, int> pp4(X[p4], Y[p8]);
                  if (check(pp1, pp2, pp3, pp4)) return 0;
                }
  puts("NO");
}