#include <bits/stdc++.h>
using namespace std;
const int maxge = 100010;
const int maxtreetop = 8192;
const int maxn = 3001;
struct Trect {
  int x1, y1, x2, y2;
} rect[maxge + 1];
int shang[maxn + 1][maxn + 1], you[maxn + 1][maxn + 1], xia[maxn + 1][maxn + 1],
    zuo[maxn + 1][maxn + 1];
int nextt[maxn + 1], f[maxn + 1];
bool ky[maxn + 1];
int n, ge;
int mianji[maxn + 1][maxn + 1];
int X1, Y1, X2, Y2;
int maxlen = 0;
void init() {
  int i, x1, y1, x2, y2;
  pair<int, pair<int, int> > tmp;
  pair<int, pair<int, pair<int, int> > > qq;
  n = maxn;
  scanf("%d", &ge);
  for (i = 1; i <= ge; ++i) {
    scanf("%d%d%d%d", &rect[i].x1, &rect[i].y1, &rect[i].x2, &rect[i].y2);
    x1 = rect[i].x1;
    y1 = rect[i].y1;
    x2 = rect[i].x2;
    y2 = rect[i].y2;
  }
}
void calc_shang_you() {
  int i, j, k;
  for (i = 1; i <= ge; ++i) {
    for (j = rect[i].y1; j < rect[i].y2; ++j)
      shang[rect[i].x1][j] = shang[rect[i].x2][j] = 1;
    for (j = rect[i].x1; j < rect[i].x2; ++j)
      you[rect[i].y1][j] = you[rect[i].y2][j] = 1;
  }
  for (i = 0; i <= n; ++i) {
    xia[i][1] = shang[i][0];
    for (j = 2; j <= n; ++j) {
      xia[i][j] = shang[i][j - 1];
      if (xia[i][j]) xia[i][j] = 1 + xia[i][j - 1];
    }
    zuo[i][1] = you[i][0];
    for (j = 2; j <= n; ++j) {
      zuo[i][j] = you[i][j - 1];
      if (zuo[i][j]) zuo[i][j] = 1 + zuo[i][j - 1];
    }
  }
  for (i = 0; i <= n; ++i) {
    for (j = n - 1; j >= 0; --j)
      if (shang[i][j]) shang[i][j] = 1 + shang[i][j + 1];
    for (j = n - 1; j >= 0; --j)
      if (you[i][j]) you[i][j] = 1 + you[i][j + 1];
  }
}
void calc_mianji() {
  int i, j, k, sum;
  for (i = 0; i < n; ++i)
    for (j = 0; j < n; ++j) mianji[i][j] = 0;
  for (i = 1; i <= ge; ++i) {
    for (j = rect[i].x1; j < rect[i].x2; ++j)
      for (k = rect[i].y1; k < rect[i].y2; ++k) mianji[j][k] = 1;
  }
  for (i = 0; i < n; ++i) {
    sum = 0;
    for (j = 0; j < n; ++j) {
      sum += mianji[i][j];
      mianji[i][j] = sum + mianji[i - 1][j];
    }
  }
}
void ys(int t) {
  int df, s;
  df = t;
  while (!ky[df]) df = nextt[df];
  while (t != df) {
    s = nextt[t];
    nextt[t] = df;
    t = s;
  }
}
int calcmj(int x1, int y2, int x2, int y1) {
  int q, q2 = 0, q3 = 0, q4 = 0;
  q = mianji[x2 - 1][y2 - 1];
  if (x1 >= 0) q3 = mianji[x1 - 1][y2 - 1];
  if (y1 >= 0) q2 = mianji[x2 - 1][y1 - 1];
  if ((x1 >= 0) && (y1 >= 0)) q4 = mianji[x1 - 1][y1 - 1];
  return q - q2 - q3 + q4;
}
void calc_result() {
  int x, y, t, start, stop, l, df, s;
  for (int w = 1; w <= n + n - 1; ++w) {
    if (w <= n) {
      x = 0;
      y = w;
    } else {
      x = w - n;
      y = n;
    }
    start = x;
    while ((x <= n) && (y >= 0)) {
      f[x] = xia[x][y];
      if (you[y][x] < f[x]) f[x] = you[y][x];
      ky[x] = true;
      if (x > start) {
        nextt[x - 1] = x;
        l = zuo[y][x];
        if (shang[x][y] < l) l = shang[x][y];
        if (l > 0) {
          t = x - l;
          if (t < start) t = start;
          if (!ky[t]) {
            ys(t);
            t = nextt[t];
          }
          while (t < x) {
            if (!ky[t]) {
              ys(t);
              t = nextt[t];
            }
            if (t < x) {
              if (t + f[t] >= x) {
                if (calcmj(t, x + y - t, x, y) < (x - t) * (x - t)) {
                  ky[t] = false;
                  t = nextt[t];
                  start = t + 1;
                } else {
                  if (x - t > maxlen) {
                    maxlen = x - t;
                    X1 = t;
                    Y1 = y;
                    X2 = x;
                    Y2 = x + y - t;
                  }
                  break;
                }
              } else {
                ky[t] = false;
                t = nextt[t];
              }
            } else
              break;
          }
        }
      }
      ++x;
      --y;
    }
  }
}
void work() {
  calc_shang_you();
  calc_mianji();
  calc_result();
}
void output() {
  int i, cnt;
  bool first = true;
  if (maxlen == 0)
    printf("NO\n");
  else {
    printf("YES ");
    cnt = 0;
    for (i = 1; i <= ge; ++i)
      if ((rect[i].x1 >= X1) && (rect[i].x2 <= X2) && (rect[i].y1 >= Y1) &&
          (rect[i].y2 <= Y2))
        ++cnt;
    printf("%d\n", cnt);
    for (i = 1; i <= ge; ++i)
      if ((rect[i].x1 >= X1) && (rect[i].x2 <= X2) && (rect[i].y1 >= Y1) &&
          (rect[i].y2 <= Y2)) {
        if (first)
          first = false;
        else
          printf(" ");
        printf("%d", i);
      }
    printf("\n");
  }
}
int main() {
  init();
  work();
  output();
  return 0;
}
