#include <bits/stdc++.h>
#pragma comment(linker, "/stack:64000000")
using namespace std;
const double eps = 1e-9;
const double PI = 2.0 * acos(0.0);
int v[3002][3002];
int area[3002][3002];
int hb[3002][3002][2];
int vb[3002][3002][2];
int nmax = 3002;
inline int get_area(int a, int b) {
  if (a < 0 || b < 0) return 0;
  return area[a][b];
}
int sol[100007];
int main() {
  int id = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    for (int px = x1; px < x2; ++px)
      for (int py = y1; py < y2; ++py) v[px + 1][py + 1] = i + 1;
  }
  for (int i = 0; i < nmax; ++i) {
    for (int j = 0; j < nmax; ++j) {
      if (v[i][j] == 0) continue;
      hb[i][j][0] = hb[i][j][1] = 1;
      if (i > 0 && v[i][j] == v[i - 1][j]) hb[i][j][0] = 0;
      if (i + 1 < nmax && v[i][j] == v[i + 1][j]) hb[i][j][1] = 0;
    }
  }
  for (int i = 0; i < nmax; ++i)
    for (int j = nmax - 1; j >= 0; --j) {
      if (j + 1 < nmax) {
        if (hb[i][j][0]) hb[i][j][0] += hb[i][j + 1][0];
        if (hb[i][j][1]) hb[i][j][1] += hb[i][j + 1][1];
      }
    }
  for (int j = 0; j < nmax; ++j) {
    for (int i = 0; i < nmax; ++i) {
      if (v[i][j] == 0) continue;
      vb[i][j][0] = vb[i][j][1] = 1;
      if (j > 0 && v[i][j] == v[i][j - 1]) vb[i][j][0] = 0;
      if (j + 1 < nmax && v[i][j] == v[i][j + 1]) vb[i][j][1] = 0;
    }
  }
  for (int j = 0; j < nmax; ++j) {
    for (int i = nmax - 1; i >= 0; --i) {
      if (i + 1 < nmax) {
        if (vb[i][j][0]) vb[i][j][0] += vb[i + 1][j][0];
        if (vb[i][j][1]) vb[i][j][1] += vb[i + 1][j][1];
      }
    }
  }
  for (int i = 0; i < nmax; ++i)
    for (int j = 0; j < nmax; ++j) {
      area[i][j] =
          get_area(i - 1, j) + get_area(i, j - 1) - get_area(i - 1, j - 1);
      if (v[i][j]) area[i][j] += 1;
    }
  int best = 0;
  int bx, by;
  for (int i = 0; i < nmax; ++i)
    for (int j = 0; j < nmax; ++j)
      if (hb[i][j][0] > best && vb[i][j][0] > best) {
        int W = hb[i][j][0];
        int H = vb[i][j][0];
        for (int best2 = best + 1; best2 <= min(W, H); ++best2) {
          int px = i + best2 - 1;
          int py = j + best2 - 1;
          if (px >= nmax || py >= nmax) break;
          if (get_area(px, py) - get_area(px, j - 1) - get_area(i - 1, py) +
                  get_area(i - 1, j - 1) !=
              best2 * best2)
            break;
          if (hb[px][j][1] < best2) continue;
          if (vb[i][py][1] < best2) continue;
          best = best2;
          bx = i;
          by = j;
        }
      }
  if (best == 0) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES " << '\n';
  set<int> my_corr;
  for (int i = 0; i < best; ++i)
    for (int j = 0; j < best; ++j) {
      sol[v[bx + i][by + j]] = 1;
      if (v[bx + i][by + j] == 0) cout << "zero;";
      my_corr.insert(v[bx + i][by + j]);
    }
  for (int i = 0; i < nmax; ++i)
    for (int j = 0; j < nmax; ++j) {
      if (i >= bx && i < bx + best && j >= by && j < by + best) continue;
      if (my_corr.find(v[i][j]) != my_corr.end()) cout << "outside";
    }
  vector<int> vlad;
  for (int i = 1; i <= n; ++i)
    if (sol[i]) vlad.push_back(i);
  cout << vlad.size() << '\n';
  for (int i = 0; i < vlad.size(); ++i) {
    if (i) cout << " ";
    cout << vlad[i];
  }
  cout << '\n';
  return 0;
}
