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 Point {
  int x, y;
  void write() { cout << y << " " << x << " "; }
};
struct Four {
  int a, b, c, d;
};
struct FourLess {
  bool operator()(const Four &f1, const Four &f2) const {
    if (f1.a == f2.a) {
      if (f1.b == f2.b) {
        if (f1.c == f2.c) {
          return f1.d < f2.d;
        }
        return f1.c < f2.c;
      }
      return f1.b < f2.b;
    }
    return f1.a < f2.a;
  }
};
struct Frame {
  Point p1, p2;
  void write() {
    p1.write();
    p2.write();
    cout << endl;
  }
};
int n, m;
char f[1005][1005];
bool fx[1005], fy[1005];
int used[1005][1005];
vector<int> x, y;
vector<Four> xperm, yperm;
Frame f1, f2;
int cnt;
bool check_four(Four &f) { return (f.b >= f.a + 2) && (f.d >= f.c + 2); }
void vsf(vector<int> &v, set<Four, FourLess> &s, int ind1, int ind2, int ind3,
         int ind4) {
  Four f;
  f.a = v[ind1];
  f.b = v[ind2];
  f.c = v[ind3];
  f.d = v[ind4];
  if (check_four(f)) s.insert(f);
}
void init_perm(vector<int> coord, vector<Four> &perm) {
  set<Four, FourLess> uniq;
  Four f;
  while (coord.size() < 4) coord.push_back(coord[0]);
  sort(coord.begin(), coord.end());
  do {
    vsf(coord, uniq, 0, 1, 2, 3);
    vsf(coord, uniq, 0, 1, 2, 0);
    vsf(coord, uniq, 0, 1, 1, 2);
    vsf(coord, uniq, 0, 1, 0, 2);
    vsf(coord, uniq, 0, 1, 2, 1);
    vsf(coord, uniq, 0, 1, 0, 1);
  } while (next_permutation(coord.begin(), coord.end()));
  for (set<Four, FourLess>::iterator it = uniq.begin(); it != uniq.end();
       it++) {
    perm.push_back(*it);
  }
}
void check_square(int x, int y, char c, int inv) {
  int cnt = 0;
  int px, py;
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      if (f[y + i][x + j] == c) {
        px = j;
        py = i;
        cnt++;
      }
    }
  }
  if (cnt == 1) {
    fx[x + (px ^ inv)] = true;
    fy[y + (py ^ inv)] = true;
  }
}
void look(bool *flags, vector<int> &v, int cur, int dt) {
  if (!flags[cur + dt]) {
    flags[cur + dt] = true;
    v.push_back(cur + dt);
  }
}
void process(bool *flags, vector<int> &v) {
  int n = v.size();
  look(flags, v, v[0], 1);
  for (int i = 1; i < n - 1; i++) {
    look(flags, v, i, -1);
    look(flags, v, i, 1);
  }
  look(flags, v, v[n - 1], -1);
}
int count_yline(int y, int x1, int x2, int color) {
  int res = 0;
  for (int i = x1; i <= x2; i++) {
    if (f[y][i] != '#') return 1000000;
    if (used[y][i] != color) {
      res++;
      used[y][i] = color;
    }
  }
  return res;
}
int count_xline(int x, int y1, int y2, int color) {
  int res = 0;
  for (int i = y1; i <= y2; i++) {
    if (f[i][x] != '#') return 1000000;
    if (used[i][x] != color) {
      res++;
      used[i][x] = color;
    }
  }
  return res;
}
bool check_frames() {
  static int color = 1;
  int ccnt = 0;
  color++;
  ccnt += count_yline(f1.p1.y, f1.p1.x, f1.p2.x, color);
  ccnt += count_yline(f1.p2.y, f1.p1.x, f1.p2.x, color);
  ccnt += count_yline(f2.p1.y, f2.p1.x, f2.p2.x, color);
  ccnt += count_yline(f2.p2.y, f2.p1.x, f2.p2.x, color);
  ccnt += count_xline(f1.p1.x, f1.p1.y, f1.p2.y, color);
  ccnt += count_xline(f1.p2.x, f1.p1.y, f1.p2.y, color);
  ccnt += count_xline(f2.p1.x, f2.p1.y, f2.p2.y, color);
  ccnt += count_xline(f2.p2.x, f2.p1.y, f2.p2.y, color);
  return ccnt == cnt;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%s", f[i] + 1);
  }
  for (int i = 0; i < max(n, m) + 2; i++) {
    f[i][0] = '.';
    f[i][m + 1] = '.';
    f[0][i] = '.';
    f[n + 1][i] = '.';
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= m; j++) {
      check_square(j, i, '#', 0);
      check_square(j, i, '.', 1);
    }
  }
  for (int i = 1; i <= m; i++) {
    if (fx[i]) x.push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    if (fy[i]) y.push_back(i);
  }
  if (x.size() > 4) {
    cout << "NO";
    return 0;
  }
  if (y.size() > 4) {
    cout << "NO";
    return 0;
  }
  if (x.size() < 2) {
    cout << "NO";
    return 0;
  }
  if (y.size() < 2) {
    cout << "NO";
    return 0;
  }
  if (x.size() < 4) process(fx, x);
  if (y.size() < 4) process(fy, y);
  init_perm(x, xperm);
  init_perm(y, yperm);
  for (int i = 0; i < n + 2; i++) {
    for (int j = 0; j < m + 2; j++) {
      if (f[i][j] == '#') cnt++;
    }
  }
  for (int i = 0; i < xperm.size(); i++) {
    f1.p1.x = xperm[i].a;
    f1.p2.x = xperm[i].b;
    f2.p1.x = xperm[i].c;
    f2.p2.x = xperm[i].d;
    for (int j = 0; j < yperm.size(); j++) {
      f1.p1.y = yperm[j].a;
      f1.p2.y = yperm[j].b;
      f2.p1.y = yperm[j].c;
      f2.p2.y = yperm[j].d;
      if (check_frames()) {
        cout << "YES" << endl;
        f1.write();
        f2.write();
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}