#include <bits/stdc++.h>
using namespace std;
int n, m, x[4], y[4], cx, cy, tot, rem;
char f[1011][1011], g[1011][1011];
set<int> sx, sy;
set<int>::iterator it;
bool work(int x1, int y1, int x2, int y2) {
  for (int i = x1; i <= x2; ++i) {
    if (g[i][y1] == '#')
      g[i][y1] = '$', --rem;
    else if (g[i][y1] == '.')
      return 1;
    if (g[i][y2] == '#')
      g[i][y2] = '$', --rem;
    else if (g[i][y2] == '.')
      return 1;
  }
  for (int i = y1 + 1; i < y2; ++i) {
    if (g[x1][i] == '#')
      g[x1][i] = '$', --rem;
    else if (g[x1][i] == '.')
      return 1;
    if (g[x2][i] == '#')
      g[x2][i] = '$', --rem;
    else if (g[x2][i] == '.')
      return 1;
  }
  return 0;
}
bool check(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
  if (x2 - x1 < 2 || y2 - y1 < 2 || x4 - x3 < 2 || y4 - y3 < 2) return 0;
  memcpy(g, f, sizeof(f));
  rem = tot;
  if (work(x1, y1, x2, y2) || work(x3, y3, x4, y4)) return 0;
  return rem == 0;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%s", f[i] + 1);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if (f[i][j] == '#') {
        ++tot;
        if (f[i - 1][j] == '#' && f[i + 1][j] == '#') sy.insert(j);
        if (f[i][j - 1] == '#' && f[i][j + 1] == '#') sx.insert(i);
      }
  if (sx.size() < 2 || sy.size() < 2) {
    puts("NO");
    return 0;
  }
  it = sx.begin();
  x[0] = *it;
  x[1] = *(++it);
  it = sx.end();
  x[3] = *(--it);
  x[2] = *(--it);
  it = sy.begin();
  y[0] = *it;
  y[1] = *(++it);
  it = sy.end();
  y[3] = *(--it);
  y[2] = *(--it);
  for (int a = 0; a < 4; ++a)
    for (int b = 0; b < 4; ++b)
      for (int c = 0; c < 4; ++c)
        for (int d = 0; d < 4; ++d)
          for (int e = 0; e < 4; ++e)
            for (int f = 0; f < 4; ++f)
              for (int g = 0; g < 4; ++g)
                for (int h = 0; h < 4; ++h)
                  if (check(x[a], y[b], x[c], y[d], x[e], y[f], x[g], y[h])) {
                    puts("YES");
                    printf("%d %d %d %d\n", x[a], y[b], x[c], y[d]);
                    printf("%d %d %d %d\n", x[e], y[f], x[g], y[h]);
                    return 0;
                  }
  puts("NO");
  return 0;
}
