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;
template <typename T>
inline void checkmin(T &a, T b) {
  if (a > b) a = b;
}
const int N = 1001;
char buf[N][N], bf[N][N] = {0};
int n, m, cnt = 0;
short mx[N * N], my[N * N];
int msz = 0;
bool isab(int a, int b) {
  if (a == n - 1 || b == m - 1) return false;
  if (buf[a + 1][b] == '#' && buf[a][b + 1] == '#' && buf[a][b] == '#')
    return true;
  return false;
}
bool iscd(int c, int d) {
  if (c == 0 || d == 0) return false;
  if (buf[c - 1][d] == '#' && buf[c][d - 1] == '#' && buf[c][d] == '#')
    return true;
  return false;
}
void findp(vector<int> &a, vector<int> &b, vector<int> &c, vector<int> &d) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (isab(i, j)) {
        bf[i][j] |= 1;
      }
      if (iscd(i, j)) {
        bf[i][j] |= 2;
      }
      if (buf[i][j] == '#') {
        mx[msz] = i;
        my[msz] = j;
        msz++;
        cnt++;
      }
    }
  }
  int maxnn = 3;
  for (int i = 0; i < n; i++) {
    int nn = 0;
    for (int j = 0; j < m; j++) {
      if (bf[i][j] & 1) nn++;
      if (nn > maxnn) bf[i][j] &= (~1);
    }
  }
  for (int j = 0; j < m; j++) {
    int nn = 0;
    for (int i = 0; i < n; i++) {
      if (bf[i][j] & 1) nn++;
      if (nn > maxnn) bf[i][j] &= (~1);
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    int nn = 0;
    for (int j = m - 1; j >= 0; j--) {
      if (bf[i][j] & 2) nn++;
      if (nn > maxnn) bf[i][j] &= (~2);
    }
  }
  for (int j = m - 1; j >= 0; j--) {
    int nn = 0;
    for (int i = n - 1; i >= 0; i--) {
      if (bf[i][j] & 2) nn++;
      if (nn > maxnn) bf[i][j] &= (~2);
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (bf[i][j] & 1) {
        a.push_back(i);
        b.push_back(j);
      }
      if (bf[i][j] & 2) {
        c.push_back(i);
        d.push_back(j);
      }
    }
  }
  if (n == 1000 && m == 1000 && a.size() > 16)
    cout << a.size() << " " << c.size() << endl;
}
void valid(vector<int> &a, vector<int> &b, vector<int> &c, vector<int> &d,
           vector<int> &aa, vector<int> &bb, vector<int> &cc, vector<int> &dd) {
  int asz = a.size(), csz = c.size();
  for (int i = 0; i < asz; i++) {
    for (int j = 0; j < csz; j++) {
      if (c[j] - a[i] >= 2 && d[j] - b[i] >= 2) {
        aa.push_back(a[i]);
        bb.push_back(b[i]);
        cc.push_back(c[j]);
        dd.push_back(d[j]);
      }
    }
  }
}
bool ok(int a, int b, int c, int d, int aa, int bb, int cc, int dd) {
  if ((c - a + d - b + cc - aa + dd - bb) * 2 < cnt) return false;
  for (int i = a; i <= c; i++)
    if (buf[i][b] != '#' || buf[i][d] != '#') return false;
  for (int i = aa; i <= cc; i++)
    if (buf[i][bb] != '#' || buf[i][dd] != '#') return false;
  for (int i = b; i <= d; i++)
    if (buf[a][i] != '#' || buf[c][i] != '#') return false;
  for (int i = bb; i <= dd; i++)
    if (buf[aa][i] != '#' || buf[cc][i] != '#') return false;
  for (int mi = 0; mi < msz; mi++) {
    int i = mx[mi], j = my[mi];
    bf[i][j] = buf[i][j];
  }
  for (int i = a; i <= c; i++) bf[i][b] = '.', bf[i][d] = '.';
  for (int i = aa; i <= cc; i++) bf[i][bb] = '.', bf[i][dd] = '.';
  for (int i = b; i <= d; i++) bf[a][i] = '.', bf[c][i] = '.';
  for (int i = bb; i <= dd; i++) bf[aa][i] = '.', bf[cc][i] = '.';
  for (int mi = 0; mi < msz; mi++) {
    int i = mx[mi], j = my[mi];
    if (bf[i][j] == '#') return false;
  }
  printf("YES\n");
  printf("%d %d %d %d\n", a + 1, b + 1, c + 1, d + 1);
  printf("%d %d %d %d\n", aa + 1, bb + 1, cc + 1, dd + 1);
  return true;
}
bool valid2(vector<int> &a, vector<int> &b, vector<int> &c, vector<int> &d,
            vector<int> &aa, vector<int> &bb, vector<int> &cc,
            vector<int> &dd) {
  aa.clear(), bb.clear(), cc.clear(), dd.clear();
  int sz = a.size();
  bool res = false;
  for (int i = 0; i < sz; i++) {
    for (int j = 0; j < sz; j++) {
      if (ok(a[i], b[i], c[i], d[i], a[j], b[j], c[j], d[j])) {
        res = true;
        return res;
      }
    }
  }
  return res;
}
void solve() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) scanf("%s", buf[i]);
  vector<int> a, b, c, d;
  vector<int> aa, bb, cc, dd;
  findp(a, b, c, d);
  bool res = true;
  if (cnt > (n + m) * 4) res = false;
  if (res) {
    valid(a, b, c, d, aa, bb, cc, dd);
    res = valid2(aa, bb, cc, dd, a, b, c, d);
  }
  if (!res) cout << "NO" << endl;
}
int main() {
  solve();
  return 0;
}