#include <bits/stdc++.h>
using namespace std;
const int maxN = 1005;
int n, m, w, cnt, tot;
char s[maxN][maxN];
int bo[maxN][maxN];
vector<int> xx, yy;
void init() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", s[i] + 1);
    for (int j = 1; j <= m; ++j)
      if (s[i][j] == '#') ++tot;
  }
  for (int i = 1; i <= n; ++i) {
    bool flag = 0;
    for (int j = 1; j <= m - 2; ++j)
      if (s[i][j] == '#' && s[i][j + 1] == '#' && s[i][j + 2] == '#') flag = 1;
    if (flag) xx.push_back(i);
  }
  for (int i = 1; i <= m; ++i) {
    bool flag = 0;
    for (int j = 1; j <= n - 2; ++j)
      if (s[j][i] == '#' && s[j + 1][i] == '#' && s[j + 2][i] == '#') flag = 1;
    if (flag) yy.push_back(i);
  }
}
bool check(int x1, int x2, int y1, int y2) {
  for (int i = x1; i <= x2; ++i) {
    if (bo[i][y1] != w) {
      if (s[i][y1] != '#') return 0;
      bo[i][y1] = w;
      ++cnt;
    }
    if (bo[i][y2] != w) {
      if (s[i][y2] != '#') return 0;
      bo[i][y2] = w;
      ++cnt;
    }
  }
  for (int i = y1; i <= y2; ++i) {
    if (bo[x1][i] != w) {
      if (s[x1][i] != '#') return 0;
      bo[x1][i] = w;
      ++cnt;
    }
    if (bo[x2][i] != w) {
      if (s[x2][i] != '#') return 0;
      bo[x2][i] = w;
      ++cnt;
    }
  }
  return 1;
}
void work() {
  int nn, mm;
  if (xx.size() > 4) xx.erase(++ ++xx.begin(), -- --xx.end());
  if (yy.size() > 4) yy.erase(++ ++yy.begin(), -- --yy.end());
  nn = xx.size() - 1;
  mm = yy.size() - 1;
  for (int ax1 = 0; ax1 <= nn; ++ax1)
    for (int ax2 = ax1; ax2 <= nn; ++ax2)
      if (xx[ax2] - xx[ax1] >= 2)
        for (int ay1 = 0; ay1 <= mm; ++ay1)
          for (int ay2 = ay1; ay2 <= mm; ++ay2)
            if (yy[ay2] - yy[ay1] >= 2)
              for (int bx1 = 0; bx1 <= nn; ++bx1)
                for (int bx2 = bx1; bx2 <= nn; ++bx2)
                  if (xx[bx2] - xx[bx1] >= 2)
                    for (int by1 = 0; by1 <= mm; ++by1)
                      for (int by2 = by1; by2 <= mm; ++by2)
                        if (yy[by2] - yy[by1] >= 2) {
                          cnt = 0;
                          ++w;
                          if (check(xx[ax1], xx[ax2], yy[ay1], yy[ay2]) &&
                              check(xx[bx1], xx[bx2], yy[by1], yy[by2]) &&
                              cnt == tot) {
                            puts("YES");
                            printf("%d %d %d %d\n", xx[ax1], yy[ay1], xx[ax2],
                                   yy[ay2]);
                            printf("%d %d %d %d\n", xx[bx1], yy[by1], xx[bx2],
                                   yy[by2]);
                            return;
                          }
                        }
  puts("NO");
}
int main() {
  init();
  work();
  return 0;
}
