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 M = 1000 + 10;
int ihash1[M], ihash2[M];
char board[M][M];
char tmp[M][M];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) {
      board[i][j] = s[j];
    }
  }
  for (int row = 0; row < n; row++) {
    for (int col = 0; col + 2 < m; col++) {
      if (board[row][col] == '#' && board[row][col + 1] == '#' &&
          board[row][col + 2] == '#') {
        ihash1[row] = 1;
      }
    }
  }
  for (int col = 0; col < m; col++) {
    for (int row = 0; row + 2 < n; row++) {
      if (board[row][col] == '#' && board[row + 1][col] == '#' &&
          board[row + 2][col] == '#') {
        ihash2[col] = 1;
      }
    }
  }
  set<int> rr;
  set<int> cc;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (ihash1[i] == 1 && cnt < 2) {
      rr.insert(i);
      cnt++;
    }
  }
  cnt = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (ihash1[i] == 1 && cnt < 2) {
      rr.insert(i);
      cnt++;
    }
  }
  cnt = 0;
  for (int i = 0; i < m; i++) {
    if (ihash2[i] == 1 && cnt < 2) {
      cc.insert(i);
      cnt++;
    }
  }
  cnt = 0;
  for (int i = m - 1; i >= 0; i--) {
    if (ihash2[i] == 1 && cnt < 2) {
      cc.insert(i);
      cnt++;
    }
  }
  bool ok = false;
  int ans1r1, ans1r2, ans1c1, ans1c2;
  int ans2r1, ans2r2, ans2c1, ans2c2;
  for (set<int>::iterator r11 = rr.begin(); r11 != rr.end(); r11++) {
    for (set<int>::iterator r12 = rr.begin(); r12 != rr.end(); r12++) {
      for (set<int>::iterator c11 = cc.begin(); c11 != cc.end(); c11++) {
        for (set<int>::iterator c12 = cc.begin(); c12 != cc.end(); c12++) {
          int row11 = (*r11);
          int row12 = (*r12);
          int col11 = (*c11);
          int col12 = (*c12);
          if (row12 - row11 >= 2 && col12 - col11 >= 2) {
            for (set<int>::iterator r21 = rr.begin(); r21 != rr.end(); r21++) {
              for (set<int>::iterator r22 = rr.begin(); r22 != rr.end();
                   r22++) {
                for (set<int>::iterator c21 = cc.begin(); c21 != cc.end();
                     c21++) {
                  for (set<int>::iterator c22 = cc.begin(); c22 != cc.end();
                       c22++) {
                    int row21 = (*r21);
                    int row22 = (*r22);
                    int col21 = (*c21);
                    int col22 = (*c22);
                    if (row22 - row21 >= 2 && col22 - col21 >= 2) {
                      for (int i = 0; i < M; i++) {
                        for (int j = 0; j < M; j++) {
                          tmp[i][j] = '.';
                        }
                      }
                      for (int row = row11; row <= row12; row++) {
                        tmp[row][col11] = tmp[row][col12] = '#';
                      }
                      for (int col = col11; col <= col12; col++) {
                        tmp[row11][col] = tmp[row12][col] = '#';
                      }
                      for (int row = row21; row <= row22; row++) {
                        tmp[row][col21] = tmp[row][col22] = '#';
                      }
                      for (int col = col21; col <= col22; col++) {
                        tmp[row21][col] = tmp[row22][col] = '#';
                      }
                      int num = 0;
                      for (int i = 0; i < n; i++) {
                        for (int j = 0; j < m; j++) {
                          if (tmp[i][j] == board[i][j]) {
                            num++;
                          }
                        }
                      }
                      if (num == n * m) {
                        ok = true;
                        ans1r1 = row11;
                        ans1r2 = row12;
                        ans1c1 = col11;
                        ans1c2 = col12;
                        ans2r1 = row21;
                        ans2r2 = row22;
                        ans2c1 = col21;
                        ans2c2 = col22;
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (ok == false) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    cout << ans1r1 + 1 << " " << ans1c1 + 1 << " " << ans1r2 + 1 << " "
         << ans1c2 + 1 << endl;
    cout << ans2r1 + 1 << " " << ans2c1 + 1 << " " << ans2r2 + 1 << " "
         << ans2c2 + 1 << endl;
  }
  return 0;
}