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;
char g[1001][1001];
vector<int> row, col;
int main() {
  int tot = 0;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%s", g[i]);
    tot += count(g[i], g[i] + m, '#');
    for (int j = 0; j < m; ++j)
      if (g[i][j] == '#') {
        int cnt = 0;
        while (j + cnt < m && g[i][j + cnt] == '#') ++cnt;
        if (cnt > 2) {
          row.push_back(i);
          break;
        }
        j += cnt - 1;
      }
  }
  for (int j = 0; j < m; ++j) {
    for (int i = 0; i < n; ++i)
      if (g[i][j] == '#') {
        int cnt = 0;
        while (i + cnt < n && g[i + cnt][j] == '#') ++cnt;
        if (cnt > 2) {
          col.push_back(j);
          break;
        }
        i += cnt - 1;
      }
  }
  if (row.size() < 2 || col.size() < 2) {
    puts("NO");
    return 0;
  }
  if (row.size() > 4) {
    row.erase(row.begin() + 2, row.end() - 2);
  }
  if (col.size() > 4) {
    col.erase(col.begin() + 2, col.end() - 2);
  }
  row.insert(row.end(), row.begin(), row.end());
  col.insert(col.end(), col.begin(), col.end());
  sort(row.begin(), row.end());
  sort(col.begin(), col.end());
  set<pair<pair<int, int>, pair<int, int> > > vis0;
  do {
    int r0 = min(row[0], row[1]);
    int r1 = max(row[0], row[1]);
    int r2 = min(row[row.size() - 2], row.back());
    int r3 = max(row[row.size() - 2], row.back());
    if (vis0.count(make_pair(make_pair(r0, r1), make_pair(r2, r3)))) continue;
    vis0.insert(make_pair(make_pair(r0, r1), make_pair(r2, r3)));
    set<pair<pair<int, int>, pair<int, int> > > vis1;
    do {
      set<pair<int, int> > used;
      int c0 = min(col[0], col[1]);
      int c1 = max(col[0], col[1]);
      int c2 = min(col[col.size() - 2], col.back());
      int c3 = max(col[col.size() - 2], col.back());
      if (vis1.count(make_pair(make_pair(c0, c1), make_pair(c2, c3)))) continue;
      vis1.insert(make_pair(make_pair(c0, c1), make_pair(c2, c3)));
      for (int i = r0; i <= r1; ++i) {
        if (g[i][c0] == '.' || g[i][c1] == '.') goto invalid;
        used.insert(make_pair(i, c0));
        used.insert(make_pair(i, c1));
      }
      for (int j = c0; j <= c1; ++j) {
        if (g[r0][j] == '.' || g[r1][j] == '.') goto invalid;
        used.insert(make_pair(r0, j));
        used.insert(make_pair(r1, j));
      }
      for (int i = r2; i <= r3; ++i) {
        if (g[i][c2] == '.' || g[i][c3] == '.') goto invalid;
        used.insert(make_pair(i, c2));
        used.insert(make_pair(i, c3));
      }
      for (int j = c2; j <= c3; ++j) {
        if (g[r2][j] == '.' || g[r3][j] == '.') goto invalid;
        used.insert(make_pair(r2, j));
        used.insert(make_pair(r3, j));
      }
      if (r1 - r0 < 2 || c1 - c0 < 2 || r3 - r2 < 2 || c3 - c2 < 2) continue;
      if ((int)used.size() == tot) {
        puts("YES");
        printf("%d %d %d %d\n", r0 + 1, c0 + 1, r1 + 1, c1 + 1);
        printf("%d %d %d %d\n", r2 + 1, c2 + 1, r3 + 1, c3 + 1);
        return 0;
      }
    invalid:;
    } while (next_permutation(col.begin(), col.end()));
  } while (next_permutation(row.begin(), row.end()));
  puts("NO");
  return 0;
}