#include <bits/stdc++.h>
using namespace std;
int N, tX[100005], tY[100005], bX[100005], bY[100005];
int tCorner[3001 + 5][3001 + 5];
int cum[3001 + 5][3001 + 5];
bool vertB[3001 + 5][3001 + 5], horiB[3001 + 5][3001 + 5];
int grCoun, actCoun, horiG[3001 + 5][3001 + 5], vertG[3001 + 5][3001 + 5];
int horiAct[100005], vertAct[100005];
vector<int> hAll[100005 + 5], vAll[100005 + 5];
bool hasRect, isHori;
vector<int> ans;
int rArea(int _y1, int _x1, int _y2, int _x2) {
  return cum[_y2][_x2] - cum[_y1][_x2] - cum[_y2][_x1] + cum[_y1][_x1];
}
int main() {
  scanf("%d", &N);
  memset(tCorner, -1, sizeof(tCorner));
  for (int(i) = (0); (i) < (N); ++(i)) {
    scanf("%d %d %d %d", &tX[i], &tY[i], &bX[i], &bY[i]);
    tCorner[tY[i]][tX[i]] = i;
  }
  for (int(i) = (0); (i) < (N); ++(i)) {
    for (int(p) = (tY[i] + 1); (p) < (bY[i] + 1); ++(p)) {
      for (int(t) = (tX[i] + 1); (t) < (bX[i] + 1); ++(t)) {
        cum[p][t]++;
      }
    }
  }
  for (int(i) = (1); (i) < (3001); ++(i))
    for (int(p) = (1); (p) < (3001); ++(p))
      cum[i][p] += (cum[i - 1][p] + cum[i][p - 1] - cum[i - 1][p - 1]);
  for (int(i) = (0); (i) < (N); ++(i)) {
    for (int(j) = (tX[i] + 1); (j) < (bX[i]); ++(j)) {
      for (int(k) = (tY[i] + 1); (k) < (bY[i] + 1); ++(k)) {
        vertB[k][j] = true;
      }
    }
    for (int(j) = (tY[i] + 1); (j) < (bY[i]); ++(j)) {
      for (int(k) = (tX[i] + 1); (k) < (bX[i] + 1); ++(k)) {
        horiB[j][k] = true;
      }
    }
  }
  for (int(i) = (0); (i) < (3001); ++(i)) {
    grCoun++;
    hasRect = false;
    for (int(p) = (0); (p) < (3001); ++(p)) {
      if (horiB[i][p]) {
        grCoun++;
        hasRect = false;
      }
      horiG[i][p] = grCoun;
      if (tCorner[i][p] != -1) {
        if (!hasRect) actCoun++;
        hAll[actCoun].push_back(tCorner[i][p]);
        horiAct[tCorner[i][p]] = actCoun;
        hasRect = true;
      }
    }
  }
  grCoun = actCoun = 0;
  for (int(p) = (0); (p) < (3001); ++(p)) {
    grCoun++;
    hasRect = false;
    for (int(i) = (0); (i) < (3001); ++(i)) {
      if (vertB[i][p]) {
        grCoun++;
        hasRect = false;
      }
      vertG[i][p] = grCoun;
      if (tCorner[i][p] != -1) {
        if (!hasRect) actCoun++;
        vAll[actCoun].push_back(tCorner[i][p]);
        vertAct[tCorner[i][p]] = actCoun;
        hasRect = true;
      }
    }
  }
  for (int(i) = (0); (i) < (N); ++(i)) {
    vector<int> &sV = (hAll[horiAct[i]].size() < vAll[vertAct[i]].size())
                          ? hAll[horiAct[i]]
                          : vAll[vertAct[i]];
    isHori = (hAll[horiAct[i]].size() < vAll[vertAct[i]].size());
    for (int(p) = (0); (p) < (sV.size()); ++(p)) {
      int cR = sV[p];
      int cD = tX[cR] - tX[i] + tY[cR] - tY[i];
      if (cD < 0) continue;
      if (isHori)
        cD = bX[cR] - tX[i];
      else
        cD = bY[cR] - tY[i];
      do {
        if (cD + tY[i] >= 3001 || cD + tX[i] >= 3001) break;
        if (horiG[tY[i]][tX[i]] != horiG[tY[i]][tX[i] + cD]) break;
        if (vertG[tY[i]][tX[i]] != vertG[tY[i] + cD][tX[i]]) break;
        if (horiG[tY[i] + cD][tX[i]] != horiG[tY[i] + cD][tX[i] + cD]) break;
        if (vertG[tY[i]][tX[i] + cD] != vertG[tY[i] + cD][tX[i] + cD]) break;
        if (rArea(tY[i], tX[i], tY[i] + cD, tX[i] + cD) == cD * cD) {
          for (int(t) = (0); (t) < (N); ++(t)) {
            if (tY[t] >= tY[i] && tX[t] >= tX[i]) {
              if (bY[t] <= tY[i] + cD && bX[t] <= tX[i] + cD) ans.push_back(t);
            }
          }
          printf("YES %d\n", ans.size());
          for (int(t) = (0); (t) < (ans.size()); ++(t))
            printf("%d ", ans[t] + 1);
          return 0;
        }
      } while (false);
    }
  }
  printf("NO\n");
  return 0;
}
