#include <bits/stdc++.h>
using namespace std;
int n, m, num;
char a[1005][1005];
int lmax[1005][1005], umax[1005][1005];
vector<int> r, c;
bool frame(int ux, int uy, int dx, int dy, bool b[][1005], int& cnt) {
  if (dx == ux + 1 || dy == uy + 1 || a[ux][dy] != '#' || lmax[ux][dy] > uy ||
      a[dx][uy] != '#' || umax[dx][uy] > ux || a[dx][dy] != '#' ||
      lmax[dx][dy] > uy || umax[dx][dy] > ux) {
    return false;
  }
  for (int j = uy; j <= dy; ++j) {
    if (!b[ux][j]) {
      ++cnt;
      b[ux][j] = true;
    }
    if (!b[dx][j]) {
      ++cnt;
      b[dx][j] = true;
    }
  }
  for (int i = ux; i <= dx; ++i) {
    if (!b[i][uy]) {
      ++cnt;
      b[i][uy] = true;
    }
    if (!b[i][dy]) {
      ++cnt;
      b[i][dy] = true;
    }
  }
  return true;
}
void reset(int ux, int uy, int dx, int dy, bool b[][1005]) {
  for (int j = uy; j <= dy; ++j) {
    b[ux][j] = false;
    b[dx][j] = false;
  }
  for (int i = ux; i <= dx; ++i) {
    b[i][uy] = false;
    b[i][dy] = false;
  }
}
bool gao() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", &a[i][1]);
  }
  for (int i = 1; i <= n; ++i) {
    int cnt = 0;
    bool f = false;
    for (int j = 1; j <= m; ++j) {
      if (a[i][j] == '#') {
        ++num;
        if (!cnt) {
          lmax[i][j] = j;
        } else {
          lmax[i][j] = lmax[i][j - 1];
        }
        if (++cnt >= 3) f = true;
      } else {
        cnt = 0;
      }
    }
    if (f) r.push_back(i);
  }
  if (r.size() > 4) {
    int t1 = r[r.size() - 1];
    int t2 = r[r.size() - 2];
    r.resize(2);
    r.push_back(t1);
    r.push_back(t2);
  }
  if (r.size() <= 1) return false;
  for (int j = 1; j <= m; ++j) {
    int cnt = 0;
    bool f = false;
    for (int i = 1; i <= n; ++i) {
      if (a[i][j] == '#') {
        if (!cnt) {
          umax[i][j] = i;
        } else {
          umax[i][j] = umax[i - 1][j];
        }
        if (++cnt >= 3) f = true;
      } else {
        cnt = 0;
      }
    }
    if (f) c.push_back(j);
  }
  if (c.size() > 4) {
    int t1 = c[c.size() - 1];
    int t2 = c[c.size() - 2];
    c.resize(2);
    c.push_back(t1);
    c.push_back(t2);
  }
  if (c.size() <= 1) return false;
  int p = r.size(), q = c.size();
  bool b[1005][1005] = {};
  int ui1, uj1, di1, dj1, ui2, uj2, di2, dj2;
  for (ui1 = 0; ui1 < p; ++ui1)
    for (di1 = ui1 + 1; di1 < p; ++di1)
      for (uj1 = 0; uj1 < q; ++uj1)
        for (dj1 = uj1 + 1; dj1 < q; ++dj1) {
          for (ui2 = 0; ui2 < p; ++ui2)
            for (di2 = ui2 + 1; di2 < p; ++di2)
              for (uj2 = 0; uj2 < q; ++uj2)
                for (dj2 = uj2 + 1; dj2 < q; ++dj2) {
                  int cnt = 0;
                  int ux1 = r[ui1], uy1 = c[uj1], dx1 = r[di1], dy1 = c[dj1];
                  int ux2 = r[ui2], uy2 = c[uj2], dx2 = r[di2], dy2 = c[dj2];
                  if (frame(ux1, uy1, dx1, dy1, b, cnt) &&
                      frame(ux2, uy2, dx2, dy2, b, cnt) && cnt == num) {
                    puts("YES");
                    printf("%d %d %d %d\n", ux1, uy1, dx1, dy1);
                    printf("%d %d %d %d\n", ux2, uy2, dx2, dy2);
                    return true;
                  }
                  reset(ux1, uy1, dx1, dy1, b);
                  reset(ux2, uy2, dx2, dy2, b);
                }
        }
  return false;
}
int main() {
  if (!gao()) puts("NO");
}
