#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
const int Max = 3010;
struct Rect {
  Rect() {}
  int d[4], len[4], id;
  int area() { return (d[1] - d[0]) * (d[3] - d[2]); }
} rect[N];
bool cmp0(const Rect& A, const Rect& B) {
  return A.d[0] < B.d[0] || (A.d[0] == B.d[0] && A.d[2] < B.d[2]);
}
bool cmp1(const Rect& A, const Rect& B) {
  return A.d[2] < B.d[2] || (A.d[2] == B.d[2] && A.d[0] < B.d[0]);
}
bool cmp2(const Rect& A, const Rect& B) {
  return A.d[1] > B.d[1] || (A.d[1] == B.d[1] && A.d[3] > B.d[3]);
}
bool cmp3(const Rect& A, const Rect& B) {
  return A.d[3] > B.d[3] || (A.d[3] == B.d[3] && A.d[1] > B.d[1]);
}
struct Point {
  int d, x, len;
  bool LD;
  Point(int _d, int _x, bool _ld, int _len)
      : d(_d), x(_x), LD(_ld), len(_len) {}
  bool operator<(const Point& B) const {
    return d < B.d || (d == B.d && x < B.x);
  }
};
vector<Point> vp;
int n;
int a[Max][Max];
int lowbit(int x) { return x & (-x); }
void add(int r, int c, int val) {
  while (r < Max) {
    int i = c;
    while (i < Max) {
      a[r][i] += val;
      i += lowbit(i);
    }
    r += lowbit(r);
  }
}
int sum(int r, int c) {
  int res = 0;
  while (r) {
    int i = c;
    while (i) {
      res += a[r][i];
      i -= lowbit(i);
    }
    r -= lowbit(r);
  }
  return res;
}
template <class Compare>
void process(int x1, int x2, int y1, int y2, int len, Compare cmp) {
  int x = -1, y = -1;
  for (int i = 0; i < n; ++i) {
    if (x != rect[i].d[x1]) {
      x = rect[i].d[x1];
      y = rect[i].d[y2];
    }
    if (cmp(y, rect[i].d[y2])) y = rect[i].d[y2];
    if (y == rect[i].d[y2]) {
      int j = i + 1;
      while (j < n && x == rect[j].d[x1] && y == rect[j].d[y1])
        y = rect[j++].d[y2];
    }
    rect[i].len[len] = abs(y - rect[i].d[y1]);
  }
}
void out(int x1, int y1, int x2, int y2) {
  vector<int> ans;
  for (int i = 0; i < n; ++i) {
    if (rect[i].d[0] >= x1 && rect[i].d[1] <= x2 && rect[i].d[2] >= y1 &&
        rect[i].d[3] <= y2)
      ans.push_back(rect[i].id);
  }
  printf("YES %d\n", ans.size());
  for (int i = 0; i < ans.size(); ++i) {
    if (i) putchar(' ');
    printf("%d", ans[i]);
  }
  puts("");
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d%d%d", rect[i].d, rect[i].d + 2, rect[i].d + 1, rect[i].d + 3);
    for (int j = 0; j < 4; ++j) rect[i].d[j]++;
    add(rect[i].d[1], rect[i].d[3], rect[i].area());
    rect[i].id = i + 1;
  }
  sort(rect, rect + n, cmp0);
  process(0, 1, 2, 3, 0, less<int>());
  sort(rect, rect + n, cmp1);
  process(2, 3, 0, 1, 1, less<int>());
  sort(rect, rect + n, cmp2);
  process(1, 0, 3, 2, 2, greater<int>());
  sort(rect, rect + n, cmp3);
  process(3, 2, 1, 0, 3, greater<int>());
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 2; ++j) {
      int x = rect[i].d[0 + j];
      int d = rect[i].d[2 + j] - x;
      int len = min(rect[i].len[2 * j], rect[i].len[2 * j + 1]);
      vp.push_back(Point(d, x, 1 - j, len));
    }
  }
  sort(vp.begin(), vp.end());
  int d;
  vector<Point> tv;
  for (int i = 0; i < vp.size(); ++i) {
    if (d != vp[i].d) {
      d = vp[i].d;
      tv.clear();
    }
    while (tv.size()) {
      if (tv.back().x + tv.back().len < vp[i].x)
        tv.pop_back();
      else
        break;
    }
    if (vp[i].LD)
      tv.push_back(vp[i]);
    else {
      if (tv.size() && vp[i].x - vp[i].len <= tv.back().x) {
        int x1 = tv.back().x;
        int y1 = x1 + tv.back().d;
        int x2 = vp[i].x;
        int y2 = x2 + vp[i].d;
        if (x1 != x2 && sum(x2, y2) + sum(x1, y1) ==
                            sum(x1, y2) + sum(x2, y1) + (x2 - x1) * (y2 - y1)) {
          out(x1, y1, x2, y2);
          return 0;
        }
      }
    }
  }
  puts("NO");
  return 0;
}
