#include <bits/stdc++.h>
const int N = 1010;
int n, m, sum = 0, tsum, sl = 0, sr = 0, f[N][N], tmp[N][N];
struct data {
  int d, x, y;
} l[7], r[7];
void print(int l1, int l2, int r1, int r2, int w) {
  for (int i = r[r1].d; i <= r[r2].d; i++) {
    if (w == 1) {
      if (tmp[l[l1].d][i] != 1) tsum++;
      if (tmp[l[l2].d][i] != 1) tsum++;
    }
    tmp[l[l1].d][i] = w;
    tmp[l[l2].d][i] = w;
  }
  for (int i = l[l1].d; i <= l[l2].d; i++) {
    if (w == 1) {
      if (tmp[i][r[r1].d] != 1) tsum++;
      if (tmp[i][r[r2].d] != 1) tsum++;
    }
    tmp[i][r[r1].d] = w;
    tmp[i][r[r2].d] = w;
  }
}
bool check(int l1, int l2, int r1, int r2, int l3, int l4, int r3, int r4) {
  if (l[l2].d - l[l1].d < 2 || r[r2].d - r[r1].d < 2 || l[l4].d - l[l3].d < 2 ||
      r[r4].d - r[r3].d < 2)
    return (false);
  for (int i = 1; i <= sl; i++)
    if (l1 != i && l2 != i && l3 != i && l4 != i) return (false);
  for (int i = 1; i <= sr; i++)
    if (r1 != i && r2 != i && r3 != i && r4 != i) return (false);
  if (l[l1].d < r[r1].x || l[l1].d < r[r2].x || l[l2].d > r[r1].y ||
      l[l2].d > r[r2].y || r[r1].d < l[l1].x || r[r1].d < l[l2].x ||
      r[r2].d > l[l1].y || r[r2].d > l[l2].y)
    return (false);
  if (l[l3].d < r[r3].x || l[l3].d < r[r4].x || l[l4].d > r[r3].y ||
      l[l4].d > r[r4].y || r[r3].d < l[l3].x || r[r3].d < l[l4].x ||
      r[r4].d > l[l3].y || r[r4].d > l[l4].y)
    return (false);
  tsum = 0;
  print(l1, l2, r1, r2, 1);
  print(l3, l4, r3, r4, 1);
  if (tsum != sum) {
    print(l1, l2, r1, r2, 0);
    print(l3, l4, r3, r4, 0);
    return (false);
  }
  printf("YES\n");
  printf("%d %d %d %d\n", l[l1].d, r[r1].d, l[l2].d, r[r2].d);
  printf("%d %d %d %d\n", l[l3].d, r[r3].d, l[l4].d, r[r4].d);
  return (true);
}
int main() {
  int s, i, j, k, o, p, q, w, x;
  char temp;
  bool cc;
  scanf("%d %d", &n, &m);
  memset(f, 0, sizeof(f));
  memset(tmp, 0, sizeof(tmp));
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) {
      do scanf("%c", &temp);
      while (temp != '.' && temp != '#');
      if (temp == '#') {
        f[i][j] = 1;
        sum++;
      }
    }
  for (i = 1; i <= n; i++) {
    s = 0;
    for (j = 1; j <= m + 1; j++)
      if (f[i][j] == 0) {
        if (s >= 3) {
          sl++;
          l[sl].d = i;
          l[sl].x = j - s;
          l[sl].y = j - 1;
        }
        if (sl > 4) break;
        s = 0;
      } else
        s++;
    if (sl > 4) break;
  }
  for (i = 1; i <= m; i++) {
    s = 0;
    for (j = 1; j <= n + 1; j++)
      if (f[j][i] == 0) {
        if (s >= 3) {
          sr++;
          r[sr].d = i;
          r[sr].x = j - s;
          r[sr].y = j - 1;
        }
        if (sr > 4) break;
        s = 0;
      } else
        s++;
    if (sr > 4) break;
  }
  if (sl == 4) {
    cc = true;
    if (l[2].d + 1 == l[3].d &&
        (l[1].d + 1 == l[2].d || l[3].d + 1 == l[4].d)) {
      for (i = l[1].x; i <= l[1].y; i++) {
        tmp[l[1].d][i] = 1;
        tmp[l[3].d][i] = 1;
      }
      for (i = l[1].d; i <= l[3].d; i++) {
        tmp[i][l[1].x] = 1;
        tmp[i][l[1].y] = 1;
      }
      for (i = l[4].x; i <= l[4].y; i++) {
        tmp[l[2].d][i] = 1;
        tmp[l[4].d][i] = 1;
      }
      for (i = l[2].d; i <= l[4].d; i++) {
        tmp[i][l[4].x] = 1;
        tmp[i][l[4].y] = 1;
      }
      for (i = 1; i <= n; i++)
        for (j = 1; j <= m; j++)
          if (tmp[i][j] != f[i][j]) {
            cc = false;
            break;
          }
      if (cc) {
        printf("YES\n");
        printf("%d %d %d %d\n", l[1].d, l[1].x, l[3].d, l[1].y);
        printf("%d %d %d %d", l[2].d, l[4].x, l[4].d, l[4].y);
        return (0);
      }
    }
  }
  if (sr == 4) {
    cc = true;
    if (r[2].d + 1 == r[3].d &&
        (r[1].d + 1 == r[2].d || r[3].d + 1 == r[4].d)) {
      for (i = r[1].x; i <= r[1].y; i++) {
        tmp[i][r[1].d] = 1;
        tmp[i][r[3].d] = 1;
      }
      for (i = r[1].d; i <= r[3].d; i++) {
        tmp[r[1].x][i] = 1;
        tmp[r[1].y][i] = 1;
      }
      for (i = r[4].x; i <= r[4].y; i++) {
        tmp[i][r[2].d] = 1;
        tmp[i][r[4].d] = 1;
      }
      for (i = r[2].d; i <= r[4].d; i++) {
        tmp[r[4].x][i] = 1;
        tmp[r[4].y][i] = 1;
      }
      for (i = 1; i <= n; i++)
        for (j = 1; j <= m; j++)
          if (tmp[i][j] != f[i][j]) {
            cc = false;
            break;
          }
      if (cc) {
        printf("YES\n");
        printf("%d %d %d %d\n", r[1].x, r[1].d, r[1].y, r[3].d);
        printf("%d %d %d %d", r[4].x, r[2].d, r[4].y, r[4].d);
        return (0);
      }
    }
  }
  if (sl > 4 || sr > 4) {
    printf("NO");
    return (0);
  }
  for (i = 1; i < sl; i++)
    for (j = i + 1; j <= sl; j++)
      for (k = 1; k < sr; k++)
        for (o = k + 1; o <= sr; o++)
          for (p = 1; p < sl; p++)
            for (q = p + 1; q <= sl; q++)
              for (w = 1; w < sr; w++)
                for (x = w + 1; x <= sr; x++)
                  if (check(i, j, k, o, p, q, w, x)) return (0);
  printf("NO");
  return (0);
}
