#include <bits/stdc++.h>
using namespace std;
struct Rec {
  int x1, y1, x2, y2;
  Rec() {}
  Rec(int x10, int y10, int x20, int y20)
      : x1(x10), y1(y10), x2(x20), y2(y20) {}
} s[100010];
int c[3010][3010];
int dp[3010][3010];
int calc(int x1, int y1, int x2, int y2) {
  return dp[x2][y2] - dp[x2][y1 - 1] - dp[x1 - 1][y2] + dp[x1 - 1][y1 - 1];
}
bool isru[3010][3010];
bool isrd[3010][3010];
bool islu[3010][3010];
bool isld[3010][3010];
int u[3010][3010];
int d[3010][3010];
int l[3010][3010];
int r[3010][3010];
set<int> ooxx;
set<int>::iterator ll;
int main() {
  int n;
  scanf("%d", &n);
  memset(isru, false, sizeof(isru));
  memset(isrd, false, sizeof(isrd));
  memset(islu, false, sizeof(islu));
  memset(isld, false, sizeof(isld));
  memset(c, 0, sizeof(c));
  memset(u, 0, sizeof(u));
  memset(d, 0, sizeof(d));
  memset(l, 0, sizeof(l));
  memset(r, 0, sizeof(r));
  for (int k = 1; k <= n; k++) {
    int x1, y1, x2, y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    x1++;
    y1++;
    x2++;
    y2++;
    if (x1 > x2) swap(x1, x2);
    if (y1 > y2) swap(y1, y2);
    x2--;
    y2--;
    s[k] = Rec(x1, y1, x2, y2);
    for (int i = x1; i <= x2; i++)
      for (int j = y1; j <= y2; j++) c[i][j] = k;
    islu[x1][y1] = true;
    isru[x1][y2] = true;
    isld[x2][y1] = true;
    isrd[x2][y2] = true;
    for (int i = x1; i <= x2; i++) {
      l[i][y1] = 1;
      r[i][y2] = 2;
    }
    for (int j = y1; j <= y2; j++) {
      u[x1][j] = 1;
      d[x2][j] = 1;
    }
  }
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i <= 3001; i++)
    for (int j = 1; j <= 3001; j++) {
      dp[i][j] = dp[i - 1][j] + dp[i][j - 1] - dp[i - 1][j - 1];
      if (c[i][j] > 0) dp[i][j]++;
    }
  for (int i = 1; i <= 3001; i++) {
    for (int j = 3001; j >= 1; j--) {
      if (u[i][j]) u[i][j] = max(u[i][j], u[i][j + 1] + 1);
      if (d[i][j]) d[i][j] = max(d[i][j], d[i][j + 1] + 1);
    }
  }
  for (int j = 1; j <= 3001; j++) {
    for (int i = 3001; i >= 1; i--) {
      if (l[i][j]) l[i][j] = max(l[i][j], l[i + 1][j] + 1);
      if (r[i][j]) r[i][j] = max(r[i][j], r[i + 1][j] + 1);
    }
  }
  for (int k = 1; k <= n; k++) {
    int x1 = s[k].x1;
    int y1 = s[k].y1;
    for (int a = 1;; a++) {
      if (u[x1][y1] < a || l[x1][y1] < a) break;
      int x2 = x1 + a - 1;
      int y2 = y1 + a - 1;
      if (!islu[x1][y1] || !isru[x1][y2] || !isld[x2][y1] || !isrd[x2][y2])
        continue;
      if (r[x1][y2] < a || d[x2][y1] < a) continue;
      if (calc(x1, y1, x2, y2) != a * a) continue;
      ooxx.clear();
      for (int i = x1; i <= x2; i++)
        for (int j = y1; j <= y2; j++) ooxx.insert(c[i][j]);
      printf("YES %d\n", (int)ooxx.size());
      for (ll = ooxx.begin(); ll != ooxx.end(); ll++) printf("%d ", *ll);
      printf("\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
