#include <bits/stdc++.h>
using namespace std;
const int nmax = 1e3 + 5;
int rsum[nmax][nmax], csum[nmax][nmax];
vector<string> grid;
int n, m, sum;
vector<int> r_set, c_set;
struct line {
  int x0, y0, x1, y1;
  int area() {
    if (x0 > x1 || y0 > y1) return 0;
    int area = 0;
    if (x0 == x1)
      area = rsum[x1 + 1][y1 + 1] - rsum[x1 + 1][y0];
    else if (y0 == y1)
      area = csum[x1 + 1][y1 + 1] - csum[x0][y1 + 1];
    else
      assert(false);
    if (area != (x1 - x0 + 1) * (y1 - y0 + 1)) return nmax * nmax;
    return area;
  }
  line collide(line t) {
    line ans = *this;
    ans.x0 = max(ans.x0, x0);
    ans.x0 = max(ans.x0, t.x0);
    ans.x1 = min(ans.x1, x1);
    ans.x1 = min(ans.x1, t.x1);
    ans.y0 = max(ans.y0, y0);
    ans.y0 = max(ans.y0, t.y0);
    ans.y1 = min(ans.y1, y1);
    ans.y1 = min(ans.y1, t.y1);
    return ans;
  }
};
bool check(int x0, int x1, int x2, int x3, int y0, int y1, int y2, int y3) {
  if (x1 - x0 < 2 || x3 - x2 < 2 || y1 - y0 < 2 || y3 - y2 < 2) return false;
  vector<line> lines;
  lines.push_back({x0, y0, x1, y0});
  lines.push_back({x0, y0 + 1, x0, y1});
  lines.push_back({x1, y0 + 1, x1, y1});
  lines.push_back({x0 + 1, y1, x1 - 1, y1});
  lines.push_back({x2, y2, x3, y2});
  lines.push_back({x2, y2 + 1, x2, y3});
  lines.push_back({x3, y2 + 1, x3, y3});
  lines.push_back({x2 + 1, y3, x3 - 1, y3});
  int value = 0;
  for (int i = 0; i < lines.size(); ++i) value += lines[i].area();
  for (int i = 0; i < lines.size(); ++i)
    for (int j = i + 1; j < lines.size(); ++j)
      value -= (lines[i].collide(lines[j])).area();
  return value == sum;
}
int main() {
  cin >> n >> m;
  grid.resize(n);
  for (int i = 0; i < n; ++i) cin >> grid[i];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) {
      rsum[i + 1][j + 1] = rsum[i + 1][j];
      csum[i + 1][j + 1] = csum[i][j + 1];
      if (grid[i][j] == '#') {
        rsum[i + 1][j + 1]++;
        csum[i + 1][j + 1]++;
        sum++;
      }
    }
  for (int i = 2; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (grid[i][j] == '#' && grid[i - 1][j] == '#' && grid[i - 2][j] == '#')
        c_set.push_back(j);
  for (int i = 0; i < n; ++i)
    for (int j = 2; j < m; ++j)
      if (grid[i][j] == '#' && grid[i][j - 1] == '#' && grid[i][j - 2] == '#')
        r_set.push_back(i);
  sort(r_set.begin(), r_set.end());
  sort(c_set.begin(), c_set.end());
  r_set.resize(unique(r_set.begin(), r_set.end()) - r_set.begin());
  c_set.resize(unique(c_set.begin(), c_set.end()) - c_set.begin());
  if (r_set.size() > 4) r_set.erase(r_set.begin() + 2, r_set.end() - 2);
  if (c_set.size() > 4) c_set.erase(c_set.begin() + 2, c_set.end() - 2);
  int r = r_set.size(), c = c_set.size();
  for (int r0 : r_set)
    for (int r1 : r_set)
      for (int r2 : r_set)
        for (int r3 : r_set)
          for (int c0 : c_set)
            for (int c1 : c_set)
              for (int c2 : c_set)
                for (int c3 : c_set)
                  if (check(r0, r1, r2, r3, c0, c1, c2, c3)) {
                    cout << "YES\n";
                    cout << r0 + 1 << ' ' << c0 + 1 << ' ' << r1 + 1 << ' '
                         << c1 + 1 << '\n';
                    cout << r2 + 1 << ' ' << c2 + 1 << ' ' << r3 + 1 << ' '
                         << c3 + 1 << '\n';
                    return 0;
                  }
  cout << "NO\n";
}
