#include <bits/stdc++.h>
using namespace std;
const int N = 100005, C = 3005;
struct point {
  int x, y;
  point() {}
  point(int _x, int _y) {
    x = _x;
    y = _y;
  }
  void operator++() {
    x++;
    y++;
  }
};
struct rec {
  point a, b;
} po[N];
int cnt_x[C][C], cnt_y[C][C], cnt_z[C][C], mark[C][C], ans[N], n;
void Init(int ms) {
  memset(cnt_x, 0, sizeof(cnt_x));
  memset(cnt_y, 0, sizeof(cnt_y));
  memset(cnt_z, 0, sizeof(cnt_z));
  memset(mark, 0, sizeof(mark));
  for (int i = 1; i <= n; i++) {
    int sx = po[i].a.x, sy = po[i].a.y;
    int ex = po[i].b.x, ey = po[i].b.y;
    for (int r = sx; r <= ex; r++) {
      for (int c = sy; c <= ey; c++) {
        mark[r][c] = i;
      }
    }
  }
  for (int i = 0; i <= ms; i++) {
    for (int j = 0; j <= ms; j++) {
      if (mark[i][j]) cnt_z[i][j] = cnt_z[i - 1][j] + 1;
      if (mark[i][j] != mark[i][j + 1]) cnt_x[i][j] = cnt_x[i - 1][j] + 1;
      if (mark[i][j] != mark[i + 1][j]) cnt_y[i][j] = cnt_y[i][j - 1] + 1;
    }
  }
}
void Output(int id, int si) {
  int top = 0;
  for (int i = 1; i <= n; i++) {
    if (po[i].a.x <= po[id].b.x - si) continue;
    if (po[i].a.y <= po[id].b.y - si) continue;
    if (po[i].b.x > po[id].b.x) continue;
    if (po[i].b.y > po[id].b.y) continue;
    ans[top++] = i;
  }
  printf("YES %d\n", top);
  for (int i = 0; i < top; i++) {
    printf("%d%c", ans[i], (i == top - 1) ? '\n' : ' ');
  }
}
void Solve() {
  for (int i = 1; i <= n; i++) {
    int x = po[i].b.x, y = po[i].b.y;
    int ms, limit = min(cnt_z[x][y], min(cnt_x[x][y], cnt_y[x][y]));
    ms = limit;
    for (int si = 1; si <= limit; si++) {
      ms = min(ms, cnt_z[x][y - si + 1]);
      if (ms < si) break;
      if (cnt_x[x][y - si] - cnt_x[x - si][y - si] < si ||
          cnt_y[x - si][y] - cnt_y[x - si][y - si] < si)
        continue;
      Output(i, si);
      return;
    }
  }
  puts("NO");
}
int main() {
  while (scanf("%d", &n) != EOF) {
    int ms = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d%d%d%d", &po[i].a.x, &po[i].a.y, &po[i].b.x, &po[i].b.y);
      ++po[i].a;
      ms = max(ms, max(po[i].b.x, po[i].b.y));
    }
    Init(ms);
    Solve();
  }
  return 0;
}
