#include <bits/stdc++.h>
using namespace std;
struct rec {
  int a, b, c, d;
} a[110000];
int b[3100][3100], c[3100][3100], d[3100][3100], q[110000], lab[3100][3100], n;
bool p[110000];
void pri(int x, int y, int l) {
  for (int i = x; i < x + l; i++)
    for (int j = y; j < y + l; j++) p[lab[i][j]] = 1;
  for (int i = 1; i <= n; i++)
    if (p[i]) q[++q[0]] = i;
  printf("YES %d\n", q[0]);
  for (int i = 1; i <= q[0]; i++) printf("%d ", q[i]);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d%d", &a[i].a, &a[i].b, &a[i].c, &a[i].d);
    for (int j = a[i].a; j < a[i].c; j++)
      for (int k = a[i].b; k < a[i].d; k++) lab[j][k] = i, b[j][k] = 1;
    for (int j = a[i].a; j < a[i].c; j++) c[j][a[i].b] = c[j][a[i].d] = 1;
    for (int j = a[i].b; j < a[i].d; j++) d[a[i].a][j] = d[a[i].c][j] = 1;
  }
  for (int i = 3005; i >= 0; i--)
    for (int j = 3005; j >= 0; j--) {
      if (b[i][j])
        b[i][j] = min(min(b[i + 1][j], b[i][j + 1]), b[i + 1][j + 1]) + 1;
      if (c[i][j]) c[i][j] = c[i + 1][j] + 1;
      if (d[i][j]) d[i][j] = d[i][j + 1] + 1;
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= b[a[i].a][a[i].b]; j++) {
      int x = a[i].a, y = a[i].b;
      if (c[x][y] >= j && d[x][y] >= j && d[x + j][y] >= j &&
          c[x][y + j] >= j) {
        pri(x, y, j);
        return 0;
      }
    }
  printf("NO\n");
  return 0;
}
