#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
  point(int x = 0, int y = 0) : x(x), y(y) {}
};
vector<point> a, b;
char st[1005][1005];
int f[1005][1005];
int n, m;
int color(point a, point b) {
  int i, j;
  for (i = a.x; i <= b.x; ++i)
    for (j = a.y; j <= b.y; ++j)
      if (i == a.x || i == b.x || j == a.y || j == b.y) f[i][j] = 1;
}
int judge(point a0, point b0, point a1, point b1) {
  int i, j;
  memset(f, 0, sizeof(f));
  if (a1.x - a0.x < 2 || a1.y - a0.y < 2) return 0;
  if (b1.x - b0.x < 2 || b1.y - b0.y < 2) return 0;
  color(a0, a1), color(b0, b1);
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= m; ++j)
      if (f[i][j] && st[i][j] != '#' || !f[i][j] && st[i][j] != '.') return 0;
  return 1;
}
void work() {
  int i, j;
  for (i = 0; i < a.size(); ++i)
    for (j = 0; j < b.size(); ++j) {
      if (judge(a[0], a[i], b[0], b[j])) {
        puts("YES");
        printf("%d %d %d %d\n", a[0].x, a[0].y, b[0].x, b[0].y);
        printf("%d %d %d %d\n", a[i].x, a[i].y, b[j].x, b[j].y);
        return;
      }
      if (judge(a[0], a[i], b[j], b[0])) {
        puts("YES");
        printf("%d %d %d %d\n", a[0].x, a[0].y, b[j].x, b[j].y);
        printf("%d %d %d %d\n", a[i].x, a[i].y, b[0].x, b[0].y);
        return;
      }
    }
  puts("NO");
}
void pre() {
  int i, j, c;
  for (i = 1; i <= n - 2; ++i)
    if (a.size() < 5) {
      c = 0;
      for (j = 1; j <= m - 2; ++j)
        if (a.size() < 5 && c < 3)
          if (st[i][j] == '#' && st[i + 1][j] == '#' && st[i + 2][j] == '#' &&
              st[i][j + 1] == '#' && st[i][j + 2] == '#') {
            a.push_back(point(i, j));
            ++c;
          }
    }
  for (i = n; i >= 3; --i)
    if (b.size() < 5) {
      c = 0;
      for (j = m; j >= 3; --j)
        if (b.size() < 5 && c < 3)
          if (st[i][j] == '#' && st[i - 1][j] == '#' && st[i - 2][j] == '#' &&
              st[i][j - 1] == '#' && st[i][j - 2] == '#') {
            b.push_back(point(i, j));
            ++c;
          }
    }
}
int main() {
  int i, j;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; ++i) scanf("%s", st[i] + 1);
  pre();
  work();
  return 0;
}
