#include <bits/stdc++.h>
using namespace std;
int n, m;
char g[1001][1001];
vector<int> row, col;
int main() {
  int tot = 0;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%s", g[i]);
    tot += count(g[i], g[i] + m, '#');
    for (int j = 0; j < m; ++j)
      if (g[i][j] == '#') {
        int cnt = 0;
        while (j + cnt < m && g[i][j + cnt] == '#') ++cnt;
        if (cnt > 2) {
          row.push_back(i);
          break;
        }
        j += cnt - 1;
      }
  }
  for (int j = 0; j < m; ++j) {
    for (int i = 0; i < n; ++i)
      if (g[i][j] == '#') {
        int cnt = 0;
        while (i + cnt < n && g[i + cnt][j] == '#') ++cnt;
        if (cnt > 2) {
          col.push_back(j);
          break;
        }
        i += cnt - 1;
      }
  }
  if (row.size() < 2 || col.size() < 2) {
    puts("NO");
    return 0;
  }
  if (row.size() > 4) {
    row.erase(row.begin() + 2, row.end() - 2);
  }
  if (col.size() > 4) {
    col.erase(col.begin() + 2, col.end() - 2);
  }
  row.insert(row.end(), row.begin(), row.end());
  col.insert(col.end(), col.begin(), col.end());
  sort(row.begin(), row.end());
  sort(col.begin(), col.end());
  set<pair<pair<int, int>, pair<int, int> > > vis0;
  do {
    int r0 = min(row[0], row[1]);
    int r1 = max(row[0], row[1]);
    int r2 = min(row[row.size() - 2], row.back());
    int r3 = max(row[row.size() - 2], row.back());
    if (vis0.count(make_pair(make_pair(r0, r1), make_pair(r2, r3)))) continue;
    vis0.insert(make_pair(make_pair(r0, r1), make_pair(r2, r3)));
    set<pair<pair<int, int>, pair<int, int> > > vis1;
    do {
      set<pair<int, int> > used;
      int c0 = min(col[0], col[1]);
      int c1 = max(col[0], col[1]);
      int c2 = min(col[col.size() - 2], col.back());
      int c3 = max(col[col.size() - 2], col.back());
      if (vis1.count(make_pair(make_pair(c0, c1), make_pair(c2, c3)))) continue;
      vis1.insert(make_pair(make_pair(c0, c1), make_pair(c2, c3)));
      for (int i = r0; i <= r1; ++i) {
        if (g[i][c0] == '.' || g[i][c1] == '.') goto invalid;
        used.insert(make_pair(i, c0));
        used.insert(make_pair(i, c1));
      }
      for (int j = c0; j <= c1; ++j) {
        if (g[r0][j] == '.' || g[r1][j] == '.') goto invalid;
        used.insert(make_pair(r0, j));
        used.insert(make_pair(r1, j));
      }
      for (int i = r2; i <= r3; ++i) {
        if (g[i][c2] == '.' || g[i][c3] == '.') goto invalid;
        used.insert(make_pair(i, c2));
        used.insert(make_pair(i, c3));
      }
      for (int j = c2; j <= c3; ++j) {
        if (g[r2][j] == '.' || g[r3][j] == '.') goto invalid;
        used.insert(make_pair(r2, j));
        used.insert(make_pair(r3, j));
      }
      if (r1 - r0 < 2 || c1 - c0 < 2 || r3 - r2 < 2 || c3 - c2 < 2) continue;
      if ((int)used.size() == tot) {
        puts("YES");
        printf("%d %d %d %d\n", r0 + 1, c0 + 1, r1 + 1, c1 + 1);
        printf("%d %d %d %d\n", r2 + 1, c2 + 1, r3 + 1, c3 + 1);
        return 0;
      }
    invalid:;
    } while (next_permutation(col.begin(), col.end()));
  } while (next_permutation(row.begin(), row.end()));
  puts("NO");
  return 0;
}
