#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;
}
