#include <bits/stdc++.h>
using namespace std;
const int N = 1000 + 10;
char s[N][N];
int n, m;
bool f[N][N];
bool color(pair<int, int> a, pair<int, int> b) {
  if (b.first - a.first < 2 || b.second - a.second < 2) return 0;
  for (int x = (a.first); x <= (b.first); x++)
    for (int y = (a.second); y <= (b.second); y++)
      if (x == a.first || x == b.first || y == a.second || y == b.second)
        f[x][y] |= 1;
  return 1;
}
void doit(pair<int, int> a0, pair<int, int> b0, pair<int, int> a1,
          pair<int, int> b1) {
  memset(f, 0, sizeof f);
  if (!color(a0, a1)) return;
  if (!color(b0, b1)) return;
  for (int i = (1); i <= (n); i++)
    for (int j = (1); j <= (m); j++)
      if (!(f[i][j] && s[i][j] == '#' || !f[i][j] && s[i][j] == '.')) return;
  puts("YES");
  printf("%d %d %d %d\n", a0.first, a0.second, a1.first, a1.second);
  printf("%d %d %d %d\n", b0.first, b0.second, b1.first, b1.second);
  exit(0);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (1); i <= (n); i++) scanf("%s", s[i] + 1);
  vector<pair<int, int> > a, b;
  for (int i = (1); i <= (n - 2); i++)
    if (((int)(a).size()) < 5) {
      int cnt = 0;
      for (int j = (1); j <= (m - 2); j++)
        if (((int)(a).size()) < 5 && cnt < 3)
          if (s[i][j] == '#' && s[i + 1][j] == '#' && s[i + 2][j] == '#' &&
              s[i][j + 1] == '#' && s[i][j + 2] == '#')
            a.push_back(make_pair(i, j)), cnt++;
    }
  for (int i = (n); i >= (3); i--)
    if (((int)(b).size()) < 5) {
      int cnt = 0;
      for (int j = (m); j >= (3); j--)
        if (((int)(b).size()) < 5 && cnt < 3)
          if (s[i][j] == '#' && s[i - 1][j] == '#' && s[i - 2][j] == '#' &&
              s[i][j - 1] == '#' && s[i][j - 2] == '#')
            b.push_back(make_pair(i, j)), cnt++;
    }
  for (vector<pair<int, int> >::iterator x = (a).begin(); x != (a).end(); x++)
    for (vector<pair<int, int> >::iterator y = (b).begin(); y != (b).end(); y++)
      doit(a[0], *x, b[0], *y), doit(a[0], *x, *y, b[0]);
  puts("NO");
  return 0;
}
