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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int Maxn = 1005;
char s[Maxn][Maxn];
int dw[Maxn][Maxn];
int rt[Maxn][Maxn];
struct rec {
  short X1, Y1, X2, Y2;
  rec(short a, short b, short c, short d) {
    X1 = a;
    Y1 = b;
    X2 = c;
    Y2 = d;
  }
};
void print(rec x) {
  printf("%d %d %d %d\n", x.X1 + 1, 1 + x.Y1, 1 + x.X2, 1 + x.Y2);
}
int f(rec x) { return 2 * abs(x.X1 - x.X2) + 2 * abs(x.Y1 - x.Y2); }
vector<pair<int, int> > av;
int g[Maxn][Maxn];
int dc;
inline void Add(int x, int y, int v) {
  if (!g[x][y]) dc++;
  g[x][y] += v;
  if (!g[x][y]) dc--;
}
void Paint(rec x, int v = 1) {
  for (int i = x.X1; i <= x.X2; i++) {
    Add(i, x.Y1, v);
    Add(i, x.Y2, v);
  }
  for (int i = x.Y1 + 1; i < x.Y2; i++) {
    Add(x.X1, i, v);
    Add(x.X2, i, v);
  }
}
bool check(rec a, rec b) {
  Paint(a);
  Paint(b);
  int c2 = 0;
  for (int i = 0; i < av.size(); i++) {
    int x = av[i].first, y = av[i].second;
    if (g[x][y])
      c2++;
    else {
      Paint(a, -1);
      Paint(b, -1);
      return false;
    }
  }
  bool ret = c2 == dc;
  Paint(a, -1);
  Paint(b, -1);
  return ret;
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int cnt = 0;
  pair<int, int> lo, hi;
  lo = make_pair(23333, 23333), hi = make_pair(0, 0);
  for (int i = 0; i < n; i++) {
    scanf("%s", s[i]);
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '#') {
        cnt++;
        lo = min(lo, make_pair(i, j));
        if (j > hi.second || (j == hi.second && i > hi.first)) {
          hi = make_pair(i, j);
        }
        av.push_back(make_pair(i, j));
      }
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '#') {
        dw[i][j] = dw[i + 1][j] + 1;
      } else {
        dw[i][j] = 0;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = m - 1; j >= 0; j--) {
      if (s[i][j] == '#') {
        rt[i][j] = rt[i][j + 1] + 1;
      } else {
        rt[i][j] = 0;
      }
    }
  }
  if (cnt > 8000 || cnt < 8) {
    printf("NO\n");
    return 0;
  }
  vector<pair<rec, rec> > V;
  for (int i = 3; i + lo.first <= n && i <= dw[lo.first][lo.second]; i++) {
    for (int j = 3; j + lo.second <= m && j <= rt[lo.first][lo.second]; j++) {
      int ex = i + lo.first - 1, ey = j + lo.second - 1;
      if (rt[ex][lo.second] >= j && dw[lo.first][ey] >= i) {
        if (make_pair(ex, ey) != hi) {
          for (int k = 0; k < av.size(); k++) {
            int X = av[k].first, Y = av[k].second;
            if (X + 2 <= hi.first && Y + 2 <= hi.second &&
                dw[X][Y] + X - 1 >= hi.first && rt[X][Y] + Y - 1 >= hi.second &&
                rt[hi.first][Y] + Y - 1 >= hi.second &&
                dw[X][hi.second] + X - 1 >= hi.first) {
              V.push_back(make_pair(
                  rec(lo.first, lo.second, lo.first + i - 1, lo.second + j - 1),
                  rec(X, Y, hi.first, hi.second)));
              pair<rec, rec> xx = V.back();
              rec _1 = xx.first, _2 = xx.second;
              int cc = f(_1) + f(_2);
              if (cc < cnt) {
                V.pop_back();
              }
            }
          }
        } else {
          for (int k = 0; k < av.size(); k++) {
            int X = av[k].first, Y = av[k].second;
            int nd = cnt - f(rec(lo.first, lo.second, lo.first + i - 1,
                                 lo.second + j - 1));
            for (int push = 3; X + push <= n && push <= dw[X][Y]; push++) {
              for (int q = max(3, (nd - 2 * (push - 1)) / 2 + 1);
                   Y + q <= m && q <= rt[X][Y]; q++) {
                if (rt[X + push - 1][Y] >= q && dw[X][Y + q - 1] >= push) {
                  V.push_back(
                      make_pair(rec(lo.first, lo.second, lo.first + i - 1,
                                    lo.second + j - 1),
                                rec(X, Y, X + push - 1, Y + q - 1)));
                  pair<rec, rec> xx = V.back();
                  rec _1 = xx.first, _2 = xx.second;
                  int cc = f(_1) + f(_2);
                  if (cc < cnt) {
                    V.pop_back();
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  for (int i = 0; i < V.size(); i++) {
    rec _1 = V[i].first, _2 = V[i].second;
    int cc = f(_1) + f(_2);
    if (cc < cnt) {
      continue;
    }
    if (check(_1, _2)) {
      printf("YES\n");
      print(_1);
      print(_2);
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}