#include <bits/stdc++.h>
using namespace std;
struct __s {
  __s() {
    if (1) {
      ios_base::Init i;
      cin.sync_with_stdio(0);
      cin.tie(0);
    }
  }
  ~__s() {
    if (!1)
      fprintf(stderr, "Execution time: %.3lf s.\n",
              (double)clock() / CLOCKS_PER_SEC);
    long long n;
    cin >> n;
  }
} __S;
long long n, m;
bool b[1111][1111];
long long bb, mm, M;
string s;
vector<pair<pair<long long, long long>, pair<long long, long long> > > ans;
vector<long long> second;
long long t;
long long c[1111][1111], d[1111][1111];
long long f(long long x, bool r) {
  long long res = 0;
  for (long long i = ans[x].first.first; i <= ans[x].second.first; i++) {
    if (b[i][ans[x].first.second] == !r) res++;
    if (b[i][ans[x].second.second] == !r) res++;
    b[i][ans[x].first.second] = r;
    b[i][ans[x].second.second] = r;
  }
  for (long long i = ans[x].first.second; i <= ans[x].second.second; i++) {
    if (b[ans[x].first.first][i] == !r) res++;
    if (b[ans[x].second.first][i] == !r) res++;
    b[ans[x].first.first][i] = r;
    b[ans[x].second.first][i] = r;
  }
  return res;
}
long long fm(long long x, long long y) { return 2 * (x + y - 2); }
void rec(long long i, long long j, long long x, long long y, long long dx,
         long long dy) {
  for (; x < n && y < m && x >= 0 && y >= 0 && b[x][y]; x += dx, y += dy) {
    if (dx == 0 && dy == 1) {
      if (b[x + 1][y] && abs(j - y) > 1) rec(i, j, x, y, 1, 0);
    } else {
      long long mmm = fm(abs(i - x) + 1, abs(j - y) + 1);
      if (abs(i - x) > 1 && c[x][y] <= j && d[x][j] <= i && b[x][y] &&
          bb - mmm <= mm) {
        ans.push_back(make_pair(make_pair(i, j), make_pair(x, y)));
        second.push_back(mmm);
        M = max(mmm, M);
      }
    }
  }
}
bool check(long long x, long long y) {
  if (bb == f(x, false) + f(y, false)) return true;
  f(x, true);
  f(y, true);
  return false;
}
void dp() {
  for (long long i = 0; i < (long long)(n); i++) {
    long long k = 0;
    for (long long j = 0; j < (long long)(m); j++) {
      if (!b[i][j])
        k = j + 1;
      else
        c[i][j] = k;
    }
  }
  for (long long i = 0; i < (long long)(m); i++) {
    long long k = 0;
    for (long long j = 0; j < (long long)(n); j++) {
      if (!b[j][i])
        k = j + 1;
      else
        d[j][i] = k;
    }
  }
}
int main(void) {
  cin >> n >> m;
  mm = fm(n, m);
  for (long long i = 0; i < (long long)(n); i++) {
    cin >> s;
    for (long long j = 0; j < (long long)(m); j++) {
      if (s[j] == '#') {
        b[i][j] = true;
        bb++;
      }
    }
  }
  dp();
  for (long long i = 0; i < (long long)(n - 2); i++) {
    for (long long j = 0; j < (long long)(m - 2); j++) {
      if (b[i][j] && b[i + 1][j] && b[i + 2][j] && b[i][j + 1] && b[i][j + 2]) {
        rec(i, j, i, j, 0, 1);
      }
    }
  }
  for (long long i = 0; i < (long long)(ans.size()); i++) {
    if (bb - second[i] > M || (second[i] < M - 6 && ans.size() > 100)) continue;
    for (long long j = i; j < ans.size(); j++) {
      if (second[j] < bb - second[i]) continue;
      if (check(i, j)) {
        cout << "YES" << '\n';
        cout << ans[i].first.first + 1 << " " << ans[i].first.second + 1 << " "
             << ans[i].second.first + 1 << " " << ans[i].second.second + 1
             << '\n';
        cout << ans[j].first.first + 1 << " " << ans[j].first.second + 1 << " "
             << ans[j].second.first + 1 << " " << ans[j].second.second + 1
             << '\n';
        return 0;
      }
    }
  }
  cout << "NO" << '\n';
  return 0;
}
