#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int n, m;
vector<pair<int, int> > BLACK, rt;
char a[1010][1010];
bool paint(int x, int x2, int y, int y2) {
  for (int i = x; i <= x2; i++) {
    if (a[i][y] == '.' || a[i][y2] == '.') return false;
    rt.push_back(make_pair(i, y));
    rt.push_back(make_pair(i, y2));
  }
  for (int j = y; j <= y2; j++) {
    if (a[x][j] == '.' || a[x2][j] == '.') return false;
    rt.push_back(make_pair(x, j));
    rt.push_back(make_pair(x2, j));
  }
  return true;
}
void chk(vector<int> x, vector<int> y) {
  sort(x.begin(), x.end());
  sort(y.begin(), y.end());
  do {
    do {
      rt.clear();
      if (x[1] - x[0] < 2 || y[1] - y[0] < 2 || x[3] - x[2] < 2 ||
          y[3] - y[2] < 2)
        continue;
      if (!paint(x[0], x[1], y[0], y[1]) || !paint(x[2], x[3], y[2], y[3]))
        continue;
      int flag = 1;
      sort(rt.begin(), rt.end());
      int cnt = unique(rt.begin(), rt.end()) - rt.begin();
      if (cnt != BLACK.size())
        flag = 0;
      else
        for (int i = 0; i < BLACK.size(); i++)
          if (rt[i] != BLACK[i]) flag = 0;
      if (flag) {
        puts("YES");
        printf("%d %d %d %d\n", x[0] + 1, y[0] + 1, x[1] + 1, y[1] + 1);
        printf("%d %d %d %d\n", x[2] + 1, y[2] + 1, x[3] + 1, y[3] + 1);
        exit(0);
      }
    } while (next_permutation(y.begin(), y.end()));
  } while (next_permutation(x.begin(), x.end()));
}
vector<vector<int> > get(vector<int> v, set<int> s) {
  vector<vector<int> > ans;
  if (v.size() == 4) {
    ans.push_back(v);
  }
  if (v.size() == 3) {
    for (set<int>::iterator it = s.begin(); it != s.end(); it++) {
      cerr << "*it"
           << "=" << *it << '\n';
      vector<int> w = v;
      w.push_back(*it);
      ans.push_back(w);
    }
  }
  if (v.size() == 2) {
    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) {
          vector<int> w = v;
          w.push_back(*it), w.push_back(*it2);
          ans.push_back(w);
        }
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", a[i]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j] == '#') BLACK.push_back(make_pair(i, j));
  sort(BLACK.begin(), BLACK.end());
  vector<int> vx, vy;
  for (int i = 0; i < n; i++) {
    int flag = 0, cnt = 0;
    for (int j = 0; j < m; j++)
      if (a[i][j] == '#') cnt++;
    if (cnt >= 5) flag = 1;
    for (int j = 0; j < m; j++)
      if (a[i][j] == '#')
        if (i == 0 || i == n - 1 || a[i - 1][j] == '.' || a[i + 1][j] == '.')
          flag = 1;
    if (flag) vx.push_back(i);
  }
  for (int j = 0; j < m; j++) {
    int flag = 0, cnt = 0;
    for (int i = 0; i < n; i++)
      if (a[i][j] == '#') cnt++;
    if (cnt >= 5) flag = 1;
    for (int i = 0; i < n; i++)
      if (a[i][j] == '#')
        if (j == 0 || a[i][j - 1] == '.' || j == m - 1 || a[i][j + 1] == '.')
          flag = 1;
    if (flag) vy.push_back(j);
  }
  if (vx.size() < 2 || vx.size() > 4 || vy.size() < 2 || vy.size() > 4) {
    printf("NO");
    return 0;
  }
  set<int> sx, sy;
  for (int i = 0; i < vx.size(); i++)
    for (int j = -1; j <= 1; j++)
      if (vx[i] + j >= vx[0] && vx[i] + j <= vx[vx.size() - 1])
        sx.insert(vx[i] + j);
  for (int i = 0; i < vy.size(); i++)
    for (int j = -1; j <= 1; j++)
      if (vy[i] + j >= vy[0] && vy[i] + j <= vy[vy.size() - 1])
        sy.insert(vy[i] + j);
  vector<vector<int> > xcount = get(vx, sx);
  vector<vector<int> > ycount = get(vy, sy);
  for (int i = 0; i < xcount.size(); i++)
    for (int j = 0; j < ycount.size(); j++) {
      chk(xcount[i], ycount[j]);
    }
  puts("NO");
  return 0;
}
