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;
char c[1008][1008];
int n, m;
int pa[1008][1008];
int updnum;
int tot;
void wrong() {
  cout << "NO";
  exit(0);
}
int ct(int x, int y) {
  if (c[x][y] != '#') return 1e8;
  int kl = 0;
  if (updnum == 1) {
    if (pa[x][y] == 0) kl = 1;
    pa[x][y] = 1;
  } else {
    pa[x][y] = 0;
  }
  return kl;
}
int update(int x1, int y1, int x2, int y2) {
  int ans = 0;
  for (int i = y1; i <= y2; i++) {
    ans += ct(x1, i) + ct(x2, i);
  }
  for (int i = x1; i <= x2; i++) {
    ans += ct(i, y1) + ct(i, y2);
  }
  return ans;
}
bool check(vector<int> x, vector<int> y) {
  if (x[1] - x[0] >= 2 and y[1] - y[0] >= 2 and x[3] - x[2] >= 2 and
      y[3] - y[2] >= 2)
    ;
  else
    return 0;
  int ui = 0;
  updnum = 1;
  ui += update(x[0], y[0], x[1], y[1]) + update(x[2], y[2], x[3], y[3]);
  updnum = 0;
  update(x[0], y[0], x[1], y[1]);
  update(x[2], y[2], x[3], y[3]);
  if (ui == tot)
    return 1;
  else
    return 0;
}
void work(vector<int> x, vector<int> y) {
  sort(x.begin(), x.end());
  sort(y.begin(), y.end());
  vector<int> xx = x, yy = y;
  if (check(x, y)) {
    cout << "YES\n";
    cout << x[0] + 1 << " " << y[0] + 1 << " " << x[1] + 1 << " " << y[1] + 1
         << "\n"
         << x[2] + 1 << " " << y[2] + 1 << " " << x[3] + 1 << " " << y[3] + 1;
    exit(0);
  }
  while (next_permutation(x.begin(), x.end())) {
    if (check(x, y)) {
      cout << "YES\n";
      cout << x[0] + 1 << " " << y[0] + 1 << " " << x[1] + 1 << " " << y[1] + 1
           << "\n"
           << x[2] + 1 << " " << y[2] + 1 << " " << x[3] + 1 << " " << y[3] + 1;
      exit(0);
    }
  }
  x = xx, y = yy;
  while (next_permutation(y.begin(), y.end())) {
    if (check(x, y)) {
      cout << "YES\n";
      cout << x[0] + 1 << " " << y[0] + 1 << " " << x[1] + 1 << " " << y[1] + 1
           << "\n"
           << x[2] + 1 << " " << y[2] + 1 << " " << x[3] + 1 << " " << y[3] + 1;
      exit(0);
    }
  }
  x = xx, y = yy;
  while (next_permutation(x.begin(), x.end())) {
    while (next_permutation(y.begin(), y.end())) {
      if (check(x, y)) {
        cout << "YES\n";
        cout << x[0] + 1 << " " << y[0] + 1 << " " << x[1] + 1 << " "
             << y[1] + 1 << "\n"
             << x[2] + 1 << " " << y[2] + 1 << " " << x[3] + 1 << " "
             << y[3] + 1;
        exit(0);
      }
    }
  }
}
int main() {
  cin >> n >> m;
  char st;
  st = getchar();
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      c[i][j] = getchar();
      if (c[i][j] == '#') tot++;
    }
    st = getchar();
  }
  vector<int> vx, vy;
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    for (int j = 0; j < m; j++)
      if (c[i][j] == '#') cnt++;
    bool flag = 0;
    if (cnt > 4) flag = 1;
    for (int j = 0; j < m; j++) {
      if (c[i][j] == '#') {
        if (i - 1 < 0 or c[i - 1][j] == '.') flag = 1;
        if (i + 1 >= n or c[i + 1][j] == '.') flag = 1;
      }
    }
    if (flag) vx.push_back(i);
  }
  for (int i = 0; i < m; i++) {
    int cnt = 0;
    for (int j = 0; j < n; j++)
      if (c[j][i] == '#') cnt++;
    bool flag = 0;
    if (cnt > 4) flag = 1;
    for (int j = 0; j < n; j++) {
      if (c[j][i] == '#') {
        if (i - 1 < 0 or c[j][i - 1] == '.') flag = 1;
        if (i + 1 >= m or c[j][i + 1] == '.') flag = 1;
      }
    }
    if (flag) vy.push_back(i);
  }
  if (vx.size() < 2 or vx.size() > 4 or vy.size() < 2 or vy.size() > 4) wrong();
  set<int> sx, sy;
  for (int i = -1; i <= 1; i++)
    for (int j = 0; j < vx.size(); j++)
      if (vx[j] + i < n and vx[j] + i >= 0) sx.insert(vx[j] + i);
  for (int i = -1; i <= 1; i++)
    for (int j = 0; j < vy.size(); j++)
      if (vy[j] + i < m and vy[j] + i >= 0) sy.insert(vy[j] + i);
  vector<vector<int> > polx, poly;
  if (vx.size() == 4) {
    polx.push_back(vx);
  }
  if (vx.size() == 3) {
    for (set<int>::iterator it = sx.begin(); it != sx.end(); ++it) {
      vector<int> w = vx;
      w.push_back(*it);
      polx.push_back(w);
    }
  }
  if (vx.size() == 2) {
    for (set<int>::iterator it = sx.begin(); it != sx.end(); ++it) {
      for (set<int>::iterator itt = sx.begin(); itt != sx.end(); ++itt) {
        if (*it > *itt) continue;
        vector<int> w = vx;
        w.push_back(*it);
        w.push_back(*itt);
        polx.push_back(w);
      }
    }
  }
  if (vy.size() == 4) {
    poly.push_back(vy);
  }
  if (vy.size() == 3) {
    for (set<int>::iterator it = sy.begin(); it != sy.end(); ++it) {
      vector<int> w = vy;
      w.push_back(*it);
      poly.push_back(w);
    }
  }
  if (vy.size() == 2) {
    for (set<int>::iterator it = sy.begin(); it != sy.end(); ++it) {
      for (set<int>::iterator itt = sy.begin(); itt != sy.end(); ++itt) {
        if (*it > *itt) continue;
        vector<int> w = vy;
        w.push_back(*it);
        w.push_back(*itt);
        poly.push_back(w);
      }
    }
  }
  for (int i = 0; i < polx.size(); i++) {
    for (int j = 0; j < poly.size(); j++) {
      work(polx[i], poly[j]);
    }
  }
  wrong();
}