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;
int m;
int mat[1005][1005];
int sum[1005][1005];
int getSum(int x1, int y1, int x2, int y2) {
  return sum[x2][y2] - sum[x1 - 1][y2] - sum[x2][y1 - 1] + sum[x1 - 1][y1 - 1];
}
class Rectangle {
 public:
  int _x1, _y1;
  int _x2, _y2;
  bool isOK() {
    if (_y1 > _y2) {
      return 0;
    }
    if (_x2 - _x1 + 1 < 3) return 0;
    if (_y2 - _y1 + 1 < 3) return 0;
    if (getSum(_x1, _y1, _x2, _y1) != _x2 - _x1 + 1) return 0;
    if (getSum(_x1, _y1, _x1, _y2) != _y2 - _y1 + 1) return 0;
    if (getSum(_x2, _y1, _x2, _y2) != _y2 - _y1 + 1) return 0;
    if (getSum(_x1, _y2, _x2, _y2) != _x2 - _x1 + 1) return 0;
    return 1;
  }
};
Rectangle Rec1;
Rectangle Rec2;
vector<pair<int, int> > node;
vector<pair<int, int> > pointL;
vector<pair<int, int> > pointR;
bool checkPoint(int x1, int y1, int x2, int y2, int x, int y) {
  if (x == x1 && y <= y2 && y >= y1) return 1;
  if (x == x2 && y <= y2 && y >= y1) return 1;
  if (y == y1 && x <= x2 && x >= x1) return 1;
  if (y == y2 && x <= x2 && x >= x1) return 1;
  return 0;
}
bool check() {
  for (int i = 0; i < node.size(); i++) {
    if (checkPoint(Rec1._x1, Rec1._y1, Rec1._x2, Rec1._y2, node[i].first,
                   node[i].second))
      continue;
    if (checkPoint(Rec2._x1, Rec2._y1, Rec2._x2, Rec2._y2, node[i].first,
                   node[i].second))
      continue;
    return 0;
  }
  return 1;
}
bool cornerL(int x, int y) {
  if (mat[x + 1][y] == 1 && mat[x + 2][y] == 1 && mat[x][y + 1] == 1 &&
      mat[x][y + 2] == 1)
    return 1;
  return 0;
}
bool cornerR(int x, int y) {
  if (y >= 3 && mat[x][y - 1] == 1 && mat[x][y - 2] == 1 && x >= 3 &&
      mat[x - 1][y] == 1 && mat[x - 2][y] == 1)
    return 1;
  return 0;
}
vector<Rectangle> Rec;
int main() {
  cin >> n >> m;
  char s[1005];
  node.clear();
  for (int i = 1; i <= n; i++) {
    cin >> s + 1;
    for (int j = 1; j <= m; j++) {
      if (s[j] == '#') {
        mat[i][j] = 1;
        node.push_back(make_pair(i, j));
      }
      sum[i][j] = sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1] + mat[i][j];
    }
  }
  if (sum[n][m] > 4 * (n + m) - 8 || sum[n][m] < 8) {
    cout << "NO" << endl;
    return 0;
  }
  sort(node.begin(), node.end());
  pointL.clear();
  pointR.clear();
  int key[4];
  int cnt[4];
  memset(key, -1, sizeof(key));
  memset(cnt, 0, sizeof(cnt));
  for (int i = 0; i < node.size(); i++) {
    if (cornerL(node[i].first, node[i].second)) {
      for (int j = 0; j < 4; j++) {
        if (key[j] == -1) {
          key[j] = node[i].first;
          cnt[j] += 1;
          pointL.push_back(node[i]);
          break;
        } else if (node[i].first == key[j]) {
          if (cnt[j] >= 4) break;
          cnt[j] += 1;
          pointL.push_back(node[i]);
          break;
        }
      }
    }
  }
  memset(key, -1, sizeof(key));
  memset(cnt, 0, sizeof(cnt));
  for (int i = node.size() - 1; i >= 0; i--) {
    if (cornerR(node[i].first, node[i].second)) {
      for (int j = 0; j < 4; j++) {
        if (key[j] == -1) {
          key[j] = node[i].first;
          cnt[j] += 1;
          pointR.push_back(node[i]);
          break;
        } else if (node[i].first == key[j]) {
          if (cnt[j] >= 4) break;
          cnt[j] += 1;
          pointR.push_back(node[i]);
          break;
        }
      }
    }
  }
  if (pointL.size() == 0 || pointR.size() == 0) {
    cout << "NO" << endl;
    return 0;
  }
  Rec.clear();
  Rectangle Rec0;
  for (int i = 0; i < pointL.size(); i++) {
    for (int j = 0; j < pointR.size(); j++) {
      Rec0._x1 = pointL[i].first;
      Rec0._y1 = pointL[i].second;
      Rec0._x2 = pointR[j].first;
      Rec0._y2 = pointR[j].second;
      if (Rec0.isOK() == 0) continue;
      Rec.push_back(Rec0);
    }
  }
  bool f = false;
  for (int i = 0; i < Rec.size(); i++) {
    Rec1 = Rec[i];
    for (int j = 0; j < Rec.size(); j++) {
      Rec2 = Rec[j];
      f = check();
      if (f) break;
    }
    if (f) break;
  }
  if (f) {
    cout << "YES" << endl;
    cout << Rec1._x1 << " " << Rec1._y1 << " " << Rec1._x2 << " " << Rec1._y2
         << endl;
    cout << Rec2._x1 << " " << Rec2._y1 << " " << Rec2._x2 << " " << Rec2._y2
         << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}