#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int maxt = 131072 * 2;
const int rright = 131072;
struct square_t;
int n;
struct point_t {
  point_t(int _x, int _y) : x(_x), y(_y), r(-1), l(-1), t(-1), b(-1) {
    for (int i = 0; i < 4; ++i) sq[i] = NULL;
  };
  int x, y;
  int r, l, t, b, area;
  square_t* sq[4];
  void updateRightBottom();
  void updateLeftTop();
  bool operator<(const point_t& other) const {
    if (x - y != other.x - other.y) return x - y < other.x - other.y;
    return x < other.x;
  }
  bool sameDiag(const point_t& other) const {
    return other.x - other.y == x - y;
  }
};
point_t* allPoints[maxn * 4];
int numPoints = 0;
map<pair<int, int>, point_t*> pointsMap;
square_t *squares[maxn], *sortedSquares[maxn];
point_t* getPoint(int x, int y, square_t* sq, int ord) {
  if (pointsMap.find(make_pair(x, y)) == pointsMap.end()) {
    allPoints[numPoints] = new point_t(x, y);
    pointsMap.insert(make_pair(make_pair(x, y), allPoints[numPoints]));
    ++numPoints;
  }
  point_t* p = pointsMap[make_pair(x, y)];
  assert(p->sq[ord] == NULL || p->sq[ord] == sq);
  p->sq[ord] = sq;
  return p;
}
struct square_t {
  square_t(int _x1, int _y1, int _x2, int _y2)
      : x1(_x1), x2(_x2), y1(_y1), y2(_y2) {
    assert(x1 < x2);
    assert(y1 < y2);
    p[0] = getPoint(x1, y1, this, 0);
    p[1] = getPoint(x2, y1, this, 1);
    p[2] = getPoint(x1, y2, this, 2);
    p[3] = getPoint(x2, y2, this, 3);
    for (int i = 0; i < 4; ++i) {
      assert(p[i]->sq[i] == this);
    }
  }
  int area() { return (x2 - x1) * (y2 - y1); }
  point_t* p[4];
  int x1, y1, x2, y2;
};
bool cmpPoints(const point_t* a, const point_t* b) { return *a < *b; }
bool cmpForArea(const point_t* a, const point_t* b) {
  if (a->x != b->x) return a->x < b->x;
  return a->y < b->y;
}
int area(int x, int y) {
  assert(pointsMap.find(make_pair(x, y)) != pointsMap.end());
  return pointsMap[make_pair(x, y)]->area;
}
int t[maxt];
void addt(int pos, int moo) {
  pos += rright;
  while (pos >= 1) {
    t[pos] += moo;
    pos /= 2;
  }
}
int gett(int pos) {
  pos += rright;
  int ret = 0;
  while (pos >= 1) {
    if (pos % 2 == 0) {
      ret += t[pos];
      --pos;
    }
    pos /= 2;
  }
  return ret;
}
void point_t::updateLeftTop() {
  if (l != -1) return;
  if (sq[3] == NULL) {
    l = t = 0;
  } else {
    pointsMap[make_pair(sq[3]->x2, sq[3]->y1)]->updateLeftTop();
    pointsMap[make_pair(sq[3]->x1, sq[3]->y2)]->updateLeftTop();
    l = sq[3]->x2 - sq[3]->x1 + pointsMap[make_pair(sq[3]->x1, sq[3]->y2)]->l;
    t = sq[3]->y2 - sq[3]->y1 + pointsMap[make_pair(sq[3]->x2, sq[3]->y1)]->t;
  }
}
void point_t::updateRightBottom() {
  if (r != -1) return;
  if (sq[0] == NULL) {
    r = b = 0;
  } else {
    pointsMap[make_pair(sq[0]->x2, sq[0]->y1)]->updateRightBottom();
    pointsMap[make_pair(sq[0]->x1, sq[0]->y2)]->updateRightBottom();
    r = sq[0]->x2 - sq[0]->x1 + pointsMap[make_pair(sq[0]->x2, sq[0]->y1)]->r;
    b = sq[0]->y2 - sq[0]->y1 + pointsMap[make_pair(sq[0]->x1, sq[0]->y2)]->b;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x1, y1, x2, y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    assert(x1 < x2);
    assert(y1 < y2);
    squares[i] = sortedSquares[i] = new square_t(x1, y1, x2, y2);
  }
  for (int i = 0; i < n; ++i) {
    squares[i]->p[0]->updateRightBottom();
    squares[i]->p[3]->updateLeftTop();
  }
  sort(allPoints, allPoints + numPoints, cmpForArea);
  for (int i = 0; i < numPoints; ++i) {
    point_t* pt = allPoints[i];
    if (pt->sq[3]) {
      addt(pt->y, pt->sq[3]->area());
    }
    pt->area = gett(pt->y);
  }
  sort(allPoints, allPoints + numPoints, cmpPoints);
  int fs = 0;
  while (fs < numPoints) {
    int ls = fs;
    while (ls < numPoints && allPoints[ls]->sameDiag(*allPoints[fs])) ++ls;
    vector<pair<int, int> > st;
    for (int i = fs; i < ls; ++i) {
      while (st.size() &&
             st.back().second + st.back().first < allPoints[i]->x) {
        st.pop_back();
      }
      int l = min(allPoints[i]->l, allPoints[i]->t);
      int r = min(allPoints[i]->r, allPoints[i]->b);
      if (st.size() && allPoints[i]->x - l <= st.back().first) {
        int x1 = st.back().first,
            y1 = st.back().first - allPoints[i]->x + allPoints[i]->y,
            x2 = allPoints[i]->x, y2 = allPoints[i]->y;
        if (area(x2, y2) - area(x1, y2) - area(x2, y1) + area(x1, y1) ==
            (x2 - x1) * (y2 - y1)) {
          vector<int> ans;
          for (int i = 0; i < n; ++i) {
            if (squares[i]->x1 >= x1 && squares[i]->x1 < x2)
              if (squares[i]->y1 >= y1 && squares[i]->y1 < y2) ans.push_back(i);
          }
          printf("YES %d\n", (int)ans.size());
          for (int i = 0; i < ans.size(); ++i)
            printf("%d%c", ans[i] + 1, " \n"[i == ans.size() - 1]);
          return 0;
        }
      }
      st.push_back(make_pair(allPoints[i]->x, r));
    }
    fs = ls;
  }
  printf("NO\n");
  return 0;
}
