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 **a;
int overlapped(int x1, int y1, int x2, int y2) {
  int ans = 0;
  for (int i = x1; i <= x2; ++i) {
    if (a[i][y1] == 0 || a[i][y2] == 0) return 0;
    if (a[i][y1] == 1) {
      ++ans;
      a[i][y1] = -1;
    }
    if (a[i][y2] == 1) {
      a[i][y2] = -1;
      ++ans;
    }
  }
  for (int j = y1; j <= y2; ++j) {
    if (a[x1][j] == 0 || a[x2][j] == 0) return 0;
    if (a[x1][j] == 1) {
      a[x1][j] = -1;
      ++ans;
    }
    if (a[x2][j] == 1) {
      a[x2][j] = -1;
      ++ans;
    }
  }
  return ans;
}
inline void reset(int x1, int y1, int x2, int y2) {
  for (int i = x1; i <= x2; ++i) {
    if (a[i][y1] == -1) a[i][y1] = 1;
    if (a[i][y2] == -1) a[i][y2] = 1;
  }
  for (int j = y1; j <= y2; ++j) {
    if (a[x1][j] == -1) a[x1][j] = 1;
    if (a[x2][j] == -1) a[x2][j] = 1;
  }
}
int main(int argc, char const *argv[]) {
  int n, m;
  cin >> n >> m;
  a = new int *[n];
  for (int i = 0; i < n; ++i) a[i] = new int[m];
  int count = 0;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    for (int j = 0; j < m; ++j) {
      a[i][j] = (s[j] == '#' ? 1 : 0);
      count += a[i][j];
    }
  }
  int left[n][m], top[n][m];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) {
      left[i][j] = (j > 0 && a[i][j] ? left[i][j - 1] + a[i][j] : a[i][j]);
      top[i][j] = (i > 0 && a[i][j] ? top[i - 1][j] + a[i][j] : a[i][j]);
    }
  int right[n][m], bottom[n][m];
  for (int i = n - 1; i >= 0; --i)
    for (int j = m - 1; j >= 0; --j) {
      right[i][j] =
          (j + 1 < m && a[i][j] ? right[i][j + 1] + a[i][j] : a[i][j]);
      bottom[i][j] =
          (i + 1 < n && a[i][j] ? bottom[i + 1][j] + a[i][j] : a[i][j]);
    }
  vector<int> xs, ys;
  xs.reserve(n * m);
  ys.reserve(n * m);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (a[i][j]) {
        int h = left[i][j] + right[i][j] - 1;
        int v = top[i][j] + bottom[i][j] - 1;
        if (h >= 3 && v >= 3) {
          xs.push_back(i);
          ys.push_back(j);
        }
      }
    }
  }
  sort(xs.begin(), xs.end());
  xs.resize(unique(xs.begin(), xs.end()) - xs.begin());
  sort(ys.begin(), ys.end());
  ys.resize(unique(ys.begin(), ys.end()) - ys.begin());
  if (xs.size() > 4) {
    xs[2] = xs[xs.size() - 2];
    xs[3] = xs[xs.size() - 1];
    xs.resize(4);
  }
  if (ys.size() > 4) {
    ys[2] = ys[ys.size() - 2];
    ys[3] = ys[ys.size() - 1];
    ys.resize(4);
  }
  for (int x1 = 0; x1 < xs.size(); ++x1) {
    for (int x2 = 0; x2 < xs.size(); ++x2) {
      for (int x3 = 0; x3 < xs.size(); ++x3) {
        for (int x4 = 0; x4 < xs.size(); ++x4) {
          for (int y1 = 0; y1 < ys.size(); ++y1) {
            for (int y2 = 0; y2 < ys.size(); ++y2) {
              for (int y3 = 0; y3 < ys.size(); ++y3) {
                for (int y4 = 0; y4 < ys.size(); ++y4) {
                  if (abs(xs[x1] - xs[x2]) < 2 || abs(ys[y1] - ys[y2]) < 2)
                    continue;
                  if (abs(xs[x3] - xs[x4]) < 2 || abs(ys[y3] - ys[y4]) < 2)
                    continue;
                  int used = 0;
                  int firstLeft = bottom[xs[x1]][ys[y1]];
                  int firstTop = right[xs[x1]][ys[y1]];
                  int firstRight = top[xs[x2]][ys[y2]];
                  int firstBottom = left[xs[x2]][ys[y2]];
                  int secondLeft = bottom[xs[x3]][ys[y3]];
                  int secondTop = right[xs[x3]][ys[y3]];
                  int secondRight = top[xs[x4]][ys[y4]];
                  int secondBottom = left[xs[x4]][ys[y4]];
                  bool firstCorrect =
                      min(firstLeft, firstRight) >= abs(xs[x2] - xs[x1] + 1) &&
                      min(firstTop, firstBottom) >= abs(ys[y2] - ys[y1] + 1);
                  bool secondCorrent =
                      min(secondLeft, secondRight) >=
                          abs(xs[x3] - xs[x4] + 1) &&
                      min(secondTop, secondBottom) >= abs(ys[y3] - ys[y4] + 1);
                  used = overlapped(xs[x1], ys[y1], xs[x2], ys[y2]);
                  used += overlapped(xs[x3], ys[y3], xs[x4], ys[y4]);
                  reset(xs[x1], ys[y1], xs[x2], ys[y2]);
                  reset(xs[x3], ys[y3], xs[x4], ys[y4]);
                  if (firstCorrect && secondCorrent && used == count) {
                    cout << "YES" << endl;
                    cout << xs[x1] + 1 << ' ' << ys[y1] + 1 << ' ' << xs[x2] + 1
                         << ' ' << ys[y2] + 1 << endl;
                    cout << xs[x3] + 1 << ' ' << ys[y3] + 1 << ' ' << xs[x4] + 1
                         << ' ' << ys[y4] + 1 << endl;
                    return 0;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  cout << "NO";
  return 0;
}