#include <bits/stdc++.h>
using namespace std;
int N, M;
char matrix[2000][2000];
char G[2000][2000];
set<int> R, C;
void reset() {
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) G[i][j] = '.';
}
bool check() {
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++)
      if (G[i][j] != matrix[i][j]) return false;
  return true;
}
void Fill(int x, int y, int a, int b) {
  for (int i = x; i <= y; i++) G[a][i] = '#';
  for (int i = x; i <= y; i++) G[b][i] = '#';
  for (int i = a; i <= b; i++) G[i][x] = '#';
  for (int i = a; i <= b; i++) G[i][y] = '#';
}
int main() {
  cin >> N >> M;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) cin >> matrix[i][j];
  }
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) {
      if (matrix[i][j] == '#' && matrix[i][j - 1] == '#' &&
          matrix[i][j + 1] == '#')
        R.insert(i);
      if (matrix[i][j] == '#' && matrix[i - 1][j] == '#' &&
          matrix[i + 1][j] == '#')
        C.insert(j);
    }
  }
  if (R.size() > 4) R.erase(++ ++R.begin(), -- --R.end());
  if (C.size() > 4) C.erase(++ ++C.begin(), -- --C.end());
  for (set<int>::iterator fl = C.begin(); fl != C.end(); ++fl)
    for (set<int>::iterator fr = C.begin(); fr != C.end(); ++fr)
      for (set<int>::iterator fu = R.begin(); fu != R.end(); ++fu)
        for (set<int>::iterator fd = R.begin(); fd != R.end(); ++fd)
          for (set<int>::iterator sl = C.begin(); sl != C.end(); ++sl)
            for (set<int>::iterator sr = C.begin(); sr != C.end(); ++sr)
              for (set<int>::iterator su = R.begin(); su != R.end(); ++su)
                for (set<int>::iterator sd = R.begin(); sd != R.end(); ++sd) {
                  if (*fr - *fl > 1 && *fd - *fu > 1 && *sr - *sl > 1 &&
                      *sd - *su > 1) {
                    reset();
                    Fill(*fl, *fr, *fu, *fd);
                    Fill(*sl, *sr, *su, *sd);
                    if (check()) {
                      cout << "YES\n"
                           << *fu << ' ' << *fl << ' ' << *fd << ' ' << *fr
                           << endl
                           << *su << ' ' << *sl << ' ' << *sd << ' ' << *sr
                           << endl;
                      return 0;
                    }
                  }
                }
  puts("NO");
  return 0;
}
