#include <bits/stdc++.h>
void Get(int &T) {
  char C;
  bool F = 0;
  for (; C = getchar(), C < '0' || C > '9';)
    if (C == '-') F = 1;
  for (T = C - '0'; C = getchar(), C >= '0' && C <= '9'; T = T * 10 + C - '0')
    ;
  F && (T = -T);
}
void Get(char &C) {
  for (; C = getchar(), C != '.' && C != '#';)
    ;
}
int N, M;
char A[1005][1005];
void Init() {
  Get(N);
  Get(M);
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) {
      Get(A[i][j]);
    }
}
int QX[1005], QXTop;
int QY[1005], QYTop;
void Check(int X1, int Y1, int X2, int Y2, int X3, int Y3, int X4, int Y4) {
  if (X1 > X2) std::swap(X1, X2);
  if (Y1 > Y2) std::swap(Y1, Y2);
  if (X3 > X4) std::swap(X3, X4);
  if (Y3 > Y4) std::swap(Y3, Y4);
  if (X2 - X1 < 2) return;
  if (Y2 - Y1 < 2) return;
  if (X4 - X3 < 2) return;
  if (Y4 - Y3 < 2) return;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++)
      if ((((i == X1 || i == X2) && Y1 <= j && j <= Y2) ||
           ((j == Y1 || j == Y2) && X1 <= i && i <= X2) ||
           ((i == X3 || i == X4) && Y3 <= j && j <= Y4) ||
           ((j == Y3 || j == Y4) && X3 <= i && i <= X4)) != (A[i][j] == '#'))
        return;
  }
  puts("YES");
  printf("%d %d %d %d\n", X1, Y1, X2, Y2);
  printf("%d %d %d %d\n", X3, Y3, X4, Y4);
  exit(0);
}
void Work() {
  for (int i = 1; i <= N; i++)
    for (int j = 3; j <= M; j++)
      if (A[i][j] == '#' && A[i][j - 1] == '#' && A[i][j - 2] == '#') {
        QX[++QXTop] = i;
        break;
      }
  for (int j = 1; j <= M; j++)
    for (int i = 3; i <= N; i++)
      if (A[i - 1][j] == '#' && A[i][j] == '#' && A[i - 2][j] == '#') {
        QY[++QYTop] = j;
        break;
      }
  if (QYTop == 4) {
    int X1, X2, X3, X4;
    for (int i = 1; i <= N; i++)
      if (A[i][QY[1]] == '#') {
        X2 = i;
      }
    for (int i = N; i >= 1; i--)
      if (A[i][QY[1]] == '#') {
        X1 = i;
      }
    for (int i = 1; i <= N; i++)
      if (A[i][QY[4]] == '#') {
        X4 = i;
      }
    for (int i = N; i >= 1; i--)
      if (A[i][QY[4]] == '#') {
        X3 = i;
      }
    Check(X1, QY[1], X2, QY[3], X3, QY[2], X4, QY[4]);
  }
  if (QXTop == 4) {
    int Y1, Y2, Y3, Y4;
    for (int j = 1; j <= M; j++)
      if (A[QX[1]][j] == '#') {
        Y2 = j;
      }
    for (int j = M; j >= 1; j--)
      if (A[QX[1]][j] == '#') {
        Y1 = j;
      }
    for (int j = 1; j <= M; j++)
      if (A[QX[4]][j] == '#') {
        Y4 = j;
      }
    for (int j = M; j >= 1; j--)
      if (A[QX[4]][j] == '#') {
        Y3 = j;
      }
    Check(QX[1], Y1, QX[3], Y2, QX[2], Y3, QX[4], Y4);
  }
  if (QYTop <= 4 && QXTop <= 4) {
    for (int i = 1; i <= QXTop; i++)
      for (int j = 1; j <= QYTop; j++)
        for (int p = i + 1; p <= QXTop; p++)
          for (int q = j + 1; q <= QYTop; q++)
            for (int i2 = 1; i2 <= QXTop; i2++)
              for (int j2 = 1; j2 <= QYTop; j2++)
                for (int p2 = i2 + 1; p2 <= QXTop; p2++)
                  for (int q2 = j2 + 1; q2 <= QYTop; q2++) {
                    int S[5];
                    S[1] = S[2] = S[3] = S[4] = 0;
                    S[i]++;
                    S[p]++;
                    S[i2]++;
                    S[p2]++;
                    if (S[1] == 0 && 1 <= QXTop) continue;
                    if (S[2] == 0 && 2 <= QXTop) continue;
                    if (S[3] == 0 && 3 <= QXTop) continue;
                    if (S[4] == 0 && 4 <= QXTop) continue;
                    S[1] = S[2] = S[3] = S[4] = 0;
                    S[j]++;
                    S[q]++;
                    S[j2]++;
                    S[q2]++;
                    if (S[1] == 0 && 1 <= QYTop) continue;
                    if (S[2] == 0 && 2 <= QYTop) continue;
                    if (S[3] == 0 && 3 <= QYTop) continue;
                    if (S[4] == 0 && 4 <= QYTop) continue;
                    Check(QX[i], QY[j], QX[p], QY[q], QX[i2], QY[j2], QX[p2],
                          QY[q2]);
                  }
  }
}
void Output() { puts("NO"); }
int main() {
  Init();
  Work();
  Output();
  return 0;
}
