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;
struct rect {
  int x1, x2, y1, y2;
  int maxval;
  rect() {}
  rect(int a, int b, int c, int d) {
    x1 = a;
    y1 = b;
    x2 = c;
    y2 = d;
  }
};
vector<rect> rec;
int n, m;
string s[1111];
vector<int> mustx, musty;
vector<int> vx, vy;
void Print(rect fuk) {
  cout << fuk.x1 + 1 << " ";
  cout << fuk.y1 + 1 << " ";
  cout << fuk.x2 + 1 << " ";
  cout << fuk.y2 + 1 << endl;
}
bool haveedge(int a, int b, int c, int d) {
  if (abs(a - c) + 1 < 3) return 0;
  if (abs(b - d) + 1 < 3) return 0;
  for (int j = b; j < d + 1; j++)
    if (s[a][j] == '.' || s[c][j] == '.') return 0;
  for (int i = a; i < c + 1; i++)
    if (s[i][b] == '.' || s[i][d] == '.') return 0;
  return 1;
}
int Paint(rect a, rect b) {
  vector<pair<int, pair<int, int> > > ex, ey;
  ex.push_back({a.x1, {a.y1, a.y2}});
  ex.push_back({a.x2, {a.y1, a.y2}});
  ex.push_back({b.x1, {b.y1, b.y2}});
  ex.push_back({b.x2, {b.y1, b.y2}});
  ey.push_back({a.y1, {a.x1, a.x2}});
  ey.push_back({a.y2, {a.x1, a.x2}});
  ey.push_back({b.y1, {b.x1, b.x2}});
  ey.push_back({b.y2, {b.x1, b.x2}});
  sort(ex.begin(), ex.end());
  ;
  sort(ey.begin(), ey.end());
  ;
  for (int i = 1; i < ex.size(); i++) {
    if (ex[i].first == ex[i - 1].first) {
      pair<int, int> a, b;
      a = ex[i].second;
      b = ex[i - 1].second;
      if (a.first > b.second + 1 || b.first > a.second + 1) continue;
      b.first = min(b.first, a.first);
      b.second = max(b.second, a.second);
      ex[i - 1].second = b;
      ex.erase(ex.begin() + i, ex.begin() + i + 1);
      i--;
    }
  }
  for (int i = 1; i < ey.size(); i++) {
    if (ey[i].first == ey[i - 1].first) {
      pair<int, int> a, b;
      a = ey[i].second;
      b = ey[i - 1].second;
      if (a.first > b.second + 1 || b.first > a.second + 1) continue;
      b.first = min(b.first, a.first);
      b.second = max(b.second, a.second);
      ey[i - 1].second = b;
      ey.erase(ey.begin() + i, ey.begin() + i + 1);
      i--;
    }
  }
  int ret = 0;
  for (int i = 0; i < ex.size(); i++)
    ret += ex[i].second.second - ex[i].second.first + 1;
  for (int i = 0; i < ey.size(); i++)
    ret += ey[i].second.second - ey[i].second.first + 1;
  for (int i = 0; i < ex.size(); i++) {
    for (int j = 0; j < ey.size(); j++) {
      if (ex[i].first >= ey[j].second.first &&
          ex[i].first <= ey[j].second.second)
        if (ey[j].first >= ex[i].second.first &&
            ey[j].first <= ex[i].second.second) {
          ret--;
        }
    }
  }
  return ret;
}
int paint(rect fuk) {
  int a = fuk.x1;
  int b = fuk.y1;
  int c = fuk.x2;
  int d = fuk.y2;
  int ret = 0;
  for (int j = b; j < d + 1; j++) {
    if (s[a][j] == '#') {
      s[a][j] = 'f';
      ret++;
    }
    if (s[c][j] == '#') {
      s[c][j] = 'f';
      ret++;
    }
  }
  for (int i = a; i < c + 1; i++) {
    if (s[i][b] == '#') {
      s[i][b] = 'f';
      ret++;
    }
    if (s[i][d] == '#') {
      s[i][d] = 'f';
      ret++;
    }
  }
  return ret;
}
void unpaint(rect fuk) {
  int a = fuk.x1;
  int b = fuk.y1;
  int c = fuk.x2;
  int d = fuk.y2;
  for (int j = b; j < d + 1; j++) s[a][j] = '#', s[c][j] = '#';
  for (int i = a; i < c + 1; i++) s[i][b] = '#', s[i][d] = '#';
}
int ltmskx[1111], ltmsky[1111];
int lgmskx[1111111], lgmsky[1111111];
bool cmp(int a, int b) { return rec[a].maxval > rec[b].maxval; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  int tot = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '#') tot++;
    }
  }
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    bool f = 0;
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '#') {
        cnt++;
        if (cnt > 4) {
          f = 1;
          break;
        }
        if (i - 1 < 0 || s[i - 1][j] == '.') {
          f = 1;
          break;
        }
        if (i + 1 >= n || s[i + 1][j] == '.') {
          f = 1;
          break;
        }
      }
    }
    if (f) mustx.push_back(i);
  }
  for (int j = 0; j < m; j++) {
    int cnt = 0;
    bool f = 0;
    for (int i = 0; i < n; i++) {
      if (s[i][j] == '#') {
        cnt++;
        if (cnt > 4) {
          f = 1;
          break;
        }
        if (j - 1 < 0 || s[i][j - 1] == '.') {
          f = 1;
          break;
        }
        if (j + 1 >= m || s[i][j + 1] == '.') {
          f = 1;
          break;
        }
      }
    }
    if (f) musty.push_back(j);
  }
  if (mustx.size() > 4 || musty.size() > 4) {
    cout << "NO" << endl;
    ;
    return 0;
  }
  for (int i = 0; i < mustx.size(); i++)
    for (int j = -1; j < 2; j++) {
      int x = mustx[i] + j;
      if (x >= 0 && x < n) vx.push_back(x);
    }
  for (int i = 0; i < musty.size(); i++)
    for (int j = -1; j < 2; j++) {
      int y = musty[i] + j;
      if (y >= 0 && y < m) vy.push_back(y);
    }
  sort(vx.begin(), vx.end());
  ;
  vx.erase(unique(vx.begin(), vx.end()), vx.end());
  sort(vy.begin(), vy.end());
  ;
  vy.erase(unique(vy.begin(), vy.end()), vy.end());
  for (int i = 0; i < vx.size(); i++)
    for (int j = 0; j < mustx.size(); j++) {
      if (vx[i] == mustx[j]) {
        ltmskx[i] = (1 << j);
        break;
      }
    }
  for (int i = 0; i < vy.size(); i++)
    for (int j = 0; j < musty.size(); j++) {
      if (vy[i] == musty[j]) {
        ltmsky[i] = (1 << j);
        break;
      }
    }
  int mx = 0;
  for (int x1 = 0; x1 < vx.size(); x1++)
    for (int x2 = x1 + 1; x2 < vx.size(); x2++) {
      for (int y1 = 0; y1 < vy.size(); y1++)
        for (int y2 = y1 + 1; y2 < vy.size(); y2++) {
          if (haveedge(vx[x1], vy[y1], vx[x2], vy[y2])) {
            lgmskx[rec.size()] = ltmskx[x1] | ltmskx[x2];
            lgmsky[rec.size()] = ltmsky[y1] | ltmsky[y2];
            if (mustx.size() - __builtin_popcount(lgmskx[rec.size()]) > 2)
              continue;
            if (musty.size() - __builtin_popcount(lgmsky[rec.size()]) > 2)
              continue;
            rec.push_back(rect(vx[x1], vy[y1], vx[x2], vy[y2]));
            rec[rec.size() - 1].maxval =
                paint(rect(vx[x1], vy[y1], vx[x2], vy[y2]));
            mx = max(mx, rec[rec.size() - 1].maxval);
            unpaint(rect(vx[x1], vy[y1], vx[x2], vy[y2]));
          }
        }
    }
  vector<int> realrec;
  for (int i = 0; i < rec.size(); i++) {
    if (rec[i].maxval + mx >= tot) {
      realrec.push_back(i);
    }
  }
  sort(realrec.begin(), realrec.end(), cmp);
  for (int pi = 0; pi < realrec.size(); pi++)
    for (int pj = pi; pj < realrec.size(); pj++) {
      int i = realrec[pi];
      int j = realrec[pj];
      if ((lgmskx[i] | lgmskx[j]) != (1 << mustx.size()) - 1) continue;
      if ((lgmsky[i] | lgmsky[j]) != (1 << musty.size()) - 1) continue;
      int mxres = rec[i].maxval + rec[j].maxval;
      if (mxres < tot) continue;
      int res = Paint(rec[i], rec[j]);
      if (res == tot) {
        cout << "YES" << endl;
        ;
        Print(rec[i]);
        Print(rec[j]);
        return 0;
      }
    }
  cout << "NO" << endl;
  ;
  return 0;
}