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;
const int maxn = 1005;
vector<vector<int> > row, col;
vector<int> vrow, vcol;
set<int> srow, scol;
char s[maxn];
int n, m, cur, tot;
int mp[maxn][maxn], a[maxn][maxn];
bool check(vector<int> x, vector<int> y) {
  do {
    do {
      if (x[1] - x[0] < 2 || x[3] - x[2] < 2) {
        continue;
      }
      if (y[1] - y[0] < 2 || y[3] - y[2] < 2) {
        continue;
      }
      cur++;
      int cnt = 0;
      for (auto i = x[0]; i != x[1] + 1; i++) {
        int j = y[0];
        a[i][j] = cur;
        cnt++;
        if (!mp[i][j]) {
          cnt = tot + 1;
        }
        j = y[1];
        a[i][j] = cur;
        cnt++;
        if (!mp[i][j]) {
          cnt = tot + 1;
        }
      }
      for (auto j = y[0] + 1; j != y[1]; j++) {
        int i = x[0];
        a[i][j] = cur;
        cnt++;
        if (!mp[i][j]) {
          cnt = tot + 1;
        }
        i = x[1];
        a[i][j] = cur;
        cnt++;
        if (!mp[i][j]) {
          cnt = tot + 1;
        }
      }
      for (auto i = x[2]; i != x[3] + 1; i++) {
        int j = y[2];
        if (a[i][j] != cur) {
          cnt++;
        }
        a[i][j] = cur;
        if (!mp[i][j]) {
          cnt = tot + 1;
        }
        j = y[3];
        if (a[i][j] != cur) {
          cnt++;
        }
        a[i][j] = cur;
        if (!mp[i][j]) {
          cnt = tot + 1;
        }
      }
      for (auto j = y[2] + 1; j != y[3]; j++) {
        int i = x[2];
        if (a[i][j] != cur) {
          cnt++;
        }
        a[i][j] = cur;
        if (!mp[i][j]) {
          cnt = tot + 1;
        }
        i = x[3];
        if (a[i][j] != cur) {
          cnt++;
        }
        a[i][j] = cur;
        if (!mp[i][j]) {
          cnt = tot + 1;
        }
      }
      if (cnt == tot) {
        puts("YES");
        printf("%d %d %d %d\n", x[0] + 1, y[0] + 1, x[1] + 1, y[1] + 1);
        printf("%d %d %d %d\n", x[2] + 1, y[2] + 1, x[3] + 1, y[3] + 1);
        return 1;
      }
    } while (next_permutation(y.begin(), y.begin() + 4));
  } while (next_permutation(x.begin(), x.begin() + 4));
  return 0;
}
int main() {
  scanf("%d%d", &n, &m);
  for (auto i = 0; i != n; i++) {
    scanf("%s", s);
    for (auto j = 0; j != m; j++) {
      mp[i][j] = s[j] == '#';
      tot += mp[i][j];
    }
  }
  for (auto i = 0; i != n; i++) {
    int cnt = 0;
    for (auto j = 0; j != m; j++) {
      cnt += mp[i][j];
    }
    if (cnt >= 5) {
      vrow.push_back(i);
      continue;
    }
    for (auto j = 0; j != m; j++) {
      if (mp[i][j] && (i == 0 || !mp[i - 1][j])) {
        vrow.push_back(i);
        break;
      }
      if (mp[i][j] && (i == n - 1 || !mp[i + 1][j])) {
        vrow.push_back(i);
        break;
      }
    }
  }
  if (((vrow).size()) < 2 || ((vrow).size()) > 4) {
    puts("NO");
    return 0;
  }
  for (auto i = 0; i != ((vrow).size()); i++) {
    for (auto j = -1; j != 2; j++) {
      if (0 <= vrow[i] + j && vrow[i] + j < n) {
        srow.insert(vrow[i] + j);
      }
    }
  }
  if (((vrow).size()) == 4) {
    row.push_back(vrow);
  } else if (((vrow).size()) == 3) {
    for (auto it = srow.begin(); it != srow.end(); it++) {
      int x = *it;
      vector<int> tmp = vrow;
      tmp.push_back(x);
      row.push_back(tmp);
    }
  } else {
    for (auto it0 = srow.begin(); it0 != srow.end(); it0++) {
      for (auto it1 = it0; it1 != srow.end(); it1++) {
        int x = *it0, y = *it1;
        vector<int> tmp = vrow;
        tmp.push_back(x);
        tmp.push_back(y);
        row.push_back(tmp);
      }
    }
  }
  for (auto j = 0; j != m; j++) {
    int cnt = 0;
    for (auto i = 0; i != n; i++) {
      cnt += mp[i][j];
    }
    if (cnt >= 5) {
      vcol.push_back(j);
      continue;
    }
    for (auto i = 0; i != n; i++) {
      if (mp[i][j] && (j == 0 || !mp[i][j - 1])) {
        vcol.push_back(j);
        break;
      }
      if (mp[i][j] && (j == m - 1 || !mp[i][j + 1])) {
        vcol.push_back(j);
        break;
      }
    }
  }
  if (((vcol).size()) < 2 || ((vcol).size()) > 4) {
    puts("NO");
    return 0;
  }
  for (auto i = 0; i != ((vcol).size()); i++) {
    for (auto j = -1; j != 2; j++) {
      if (0 <= vcol[i] + j && vcol[i] + j < m) {
        scol.insert(vcol[i] + j);
      }
    }
  }
  if (((vcol).size()) == 4) {
    col.push_back(vcol);
  } else if (((vcol).size()) == 3) {
    for (auto it = scol.begin(); it != scol.end(); it++) {
      int x = *it;
      vector<int> tmp = vcol;
      tmp.push_back(x);
      col.push_back(tmp);
    }
  } else {
    for (auto it0 = scol.begin(); it0 != scol.end(); it0++) {
      for (auto it1 = it0; it1 != scol.end(); it1++) {
        int x = *it0, y = *it1;
        vector<int> tmp = vcol;
        tmp.push_back(x);
        tmp.push_back(y);
        col.push_back(tmp);
      }
    }
  }
  for (auto i = 0; i != ((row).size()); i++) {
    for (auto j = 0; j != ((col).size()); j++) {
      if (check(row[i], col[j])) {
        return 0;
      }
    }
  }
  puts("NO");
  return 0;
}