#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, M = 3e3 + 3;
int n;
int id[M][M][4], area[M][M];
pair<int, int> points[2 * N];
stack<pair<int, int> > st;
void clear() {
  while (!st.empty()) st.pop();
}
struct rectangle {
  int x1, y1, x2, y2;
  int a, b, c, d;
  void fin(int ind) {
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    id[x2][y1][0] = ind;
    id[x1][y1][1] = ind;
    id[x1][y2][2] = ind;
    id[x2][y2][3] = ind;
    for (int i = x1 + 1; i <= x2; i++) {
      for (int j = y2 - 1; j >= y1; j--) {
        area[i][j] = 1;
      }
    }
    a = d = x2 - x1;
    b = c = y2 - y1;
  }
} rect[N];
bool cmp(pair<int, int> a, pair<int, int> b) {
  if (a.first - a.second == b.first - b.second) return (a.first < b.first);
  return (a.first - a.second < b.first - b.second);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    rect[i].fin(i);
  }
  for (int i = 1; i <= 3000; i++) {
    for (int j = 3000; j >= 0; j--) {
      area[i][j] += area[i][j + 1] + area[i - 1][j] - area[i - 1][j + 1];
    }
  }
  for (int i = 1; i <= n; i++) {
    points[i] = make_pair(-rect[i].x1, -rect[i].y1);
  }
  sort(points + 1, points + n + 1);
  for (int i = 1; i <= n; i++) {
    int x = -points[i].first, y = -points[i].second;
    points[i] = make_pair(x, y);
    int ind = id[x][y][1];
    int ind2 = id[x + rect[ind].a][y][1];
    rect[ind].a += rect[ind2].a;
    ind2 = id[x][y + rect[ind].b][1];
    rect[ind].b += rect[ind2].b;
  }
  for (int i = 1; i <= n; i++) {
    points[i + n] = make_pair(rect[i].x2, rect[i].y2);
  }
  sort(points + n + 1, points + 2 * n + 1);
  for (int i = 1; i <= n; i++) {
    int x = points[i + n].first, y = points[i + n].second;
    int ind = id[x][y][3];
    int ind2 = id[x][y - rect[ind].c][3];
    rect[ind].c += rect[ind2].c;
    ind2 = id[x - rect[ind].d][y][3];
    rect[ind].d += rect[ind2].d;
  }
  sort(points + 1, points + 2 * n + 1, cmp);
  int k = unique(points + 1, points + 2 * n + 1) - points;
  for (int i = 1; i < k; i++) {
    int x = points[i].first, y = points[i].second;
    if (!st.empty()) {
      int x1 = st.top().first, y1 = st.top().second;
      if (x - y != x1 - y1) clear();
    }
    while (!st.empty()) {
      int x1 = st.top().first, y1 = st.top().second;
      int ind = id[x1][y1][1];
      if (x1 + min(rect[ind].a, rect[ind].b) < x)
        st.pop();
      else
        break;
    }
    if (!st.empty()) {
      int x1 = st.top().first, y1 = st.top().second;
      int ind = id[x][y][3];
      if (x - min(rect[ind].c, rect[ind].d) <= x1) {
        int inner_area = area[x][y1] + area[x1][y] - area[x1][y1] - area[x][y];
        if (inner_area == (x - x1) * (y - y1)) {
          vector<int> ans;
          for (int i = x1; i < x; i++) {
            for (int j = y1; j < y; j++) {
              if (id[i][j][1]) ans.push_back(id[i][j][1]);
            }
          }
          printf("YES %d\n", (int)ans.size());
          for (auto it : ans) {
            printf("%d ", it);
          }
          printf("\n");
          return 0;
        } else
          clear();
      }
    }
    st.push(points[i]);
  }
  printf("NO\n");
}
