#include <bits/stdc++.h>
using namespace std;
inline void Fail() {
  printf("NO");
  exit(0);
}
const int maxn = 1005;
int n, m, tot, cur;
int p[4], q[4];
char s[maxn][maxn];
vector<int> tx, ty;
set<int> sx, sy;
vector<vector<int> > px, py;
int vis[maxn][maxn];
void upd(int &a, int b) {
  if (!a) cur++;
  a += b;
}
void paint(int x1, int y1, int x2, int y2, int tp) {
  for (int i = x1 + 1; i < x2; i++) {
    if (s[i][y1] == '.' || s[i][y2] == '.') cur = 1e9;
    upd(vis[i][y1], tp);
    upd(vis[i][y2], tp);
  }
  for (int i = y1; i <= y2; i++) {
    if (s[x1][i] == '.' || s[x2][i] == '.') cur = 1e9;
    upd(vis[x1][i], tp);
    upd(vis[x2][i], tp);
  }
}
bool check(vector<int> xs, vector<int> ys) {
  for (int(i) = 0; (i) < 4; i++) p[i] = xs[i], q[i] = ys[i];
  sort(p, p + 4);
  sort(q, q + 4);
  do {
    do {
      cur = 0;
      if (p[1] - p[0] < 2 || q[1] - q[0] < 2 || p[3] - p[2] < 2 ||
          q[3] - q[2] < 2)
        continue;
      paint(p[0], q[0], p[1], q[1], 1);
      paint(p[2], q[2], p[3], q[3], 1);
      if (cur == tot) {
        printf("YES\n");
        printf("%d %d %d %d\n", p[0] + 1, q[0] + 1, p[1] + 1, q[1] + 1);
        printf("%d %d %d %d\n", p[2] + 1, q[2] + 1, p[3] + 1, q[3] + 1);
        exit(0);
      }
      paint(p[0], q[0], p[1], q[1], -1);
      paint(p[2], q[2], p[3], q[3], -1);
    } while (next_permutation(q, q + 4));
  } while (next_permutation(p, p + 4));
}
vector<vector<int> > gen(vector<int> t, set<int> s) {
  vector<vector<int> > res;
  if (t.size() == 4)
    res.push_back(t);
  else if (t.size() == 3) {
    for (set<int>::iterator it = s.begin(); it != s.end(); it++) {
      vector<int> tmp = t;
      tmp.push_back(*it);
      res.push_back(tmp);
    }
  } else {
    for (set<int>::iterator it = s.begin(); it != s.end(); it++)
      for (set<int>::iterator it2 = s.begin(); it2 != s.end(); it2++) {
        if (it == it2) continue;
        vector<int> tmp = t;
        tmp.push_back(*it);
        tmp.push_back(*it2);
        res.push_back(tmp);
      }
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int(i) = 0; (i) < n; i++) scanf("%s", s[i]);
  for (int(i) = 0; (i) < n; i++) {
    int cnt = 0;
    bool ok = false;
    for (int(j) = 0; (j) < m; j++)
      if (s[i][j] == '#') {
        cnt++;
        tot++;
        if (!i || s[i - 1][j] == '.') ok = true;
        if (i == n - 1 || s[i + 1][j] == '.') ok = true;
      }
    if (cnt >= 5 || ok) tx.push_back(i);
  }
  for (int(j) = 0; (j) < m; j++) {
    int cnt = 0;
    bool ok = false;
    for (int(i) = 0; (i) < n; i++)
      if (s[i][j] == '#') {
        cnt++;
        if (!j || s[i][j - 1] == '.') ok = true;
        if (j == m - 1 || s[i][j + 1] == '.') ok = true;
      }
    if (cnt >= 5 || ok) ty.push_back(j);
  }
  if (tx.size() < 2 || tx.size() > 4 || ty.size() < 2 || ty.size() > 4) Fail();
  for (int(i) = 0; (i) < tx.size(); i++)
    for (int j = -2; j <= 2; j++) {
      if (tx[i] + j >= tx[0] && tx[i] + j <= tx.back()) sx.insert(tx[i] + j);
    }
  for (int(i) = 0; (i) < ty.size(); i++)
    for (int j = -2; j <= 2; j++) {
      if (ty[i] + j >= ty[0] && ty[i] + j <= ty.back()) sy.insert(ty[i] + j);
    }
  px = gen(tx, sx);
  py = gen(ty, sy);
  for (int(i) = 0; (i) < px.size(); i++)
    for (int(j) = 0; (j) < py.size(); j++) {
      vector<int> xs = px[i], ys = py[j];
      check(xs, ys);
    }
  Fail();
  return 0;
}
