#include <bits/stdc++.h>
using namespace std;
const int MAXC = 3010;
const int MAXN = 100005;
int BR[MAXC][MAXC], LU[MAXC][MAXC], RU[MAXC][MAXC], TR[MAXC][MAXC];
int n, s[MAXC][MAXC], mp[MAXC][MAXC], res[MAXN];
int main() {
  scanf("%d", &n);
  memset(mp, -1, sizeof(mp));
  int x1, y1, x2, y2;
  for (int i = 0; i < n; i++) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    for (int x = x1; x < x2; x++)
      for (int y = y1; y < y2; y++) mp[x][y] = i + 1;
  }
  for (int i = 0; i < MAXC; i++) s[i][0] = s[0][i] = 0;
  for (int i = 1; i < MAXC; i++)
    for (int j = 1; j < MAXC; j++)
      s[i][j] =
          s[i - 1][j] + s[i][j - 1] - s[i - 1][j - 1] + (mp[i - 1][j - 1] > 0);
  memset(BR, 0, sizeof(BR)), memset(LU, 0, sizeof(LU)),
      memset(RU, 0, sizeof(RU)), memset(TR, 0, sizeof(TR));
  for (int i = MAXC - 1; i >= 0; i--)
    for (int j = MAXC - 1; j >= 0; j--)
      if (mp[i][j] > 0) {
        if (i == 0 || mp[i - 1][j] != mp[i][j]) LU[i][j] = LU[i][j + 1] + 1;
        if (j == 0 || mp[i][j - 1] != mp[i][j]) BR[i][j] = BR[i + 1][j] + 1;
        if (mp[i + 1][j] != mp[i][j]) RU[i][j] = RU[i][j + 1] + 1;
        if (mp[i][j + 1] != mp[i][j]) TR[i][j] = TR[i + 1][j] + 1;
      }
  for (int i = 0; i < MAXC; i++)
    for (int j = 0; j < MAXC; j++) {
      int mx = min(BR[i][j], LU[i][j]);
      for (int l = 1; l <= mx; l++) {
        if (s[i + l][j + l] - s[i + l][j] - s[i][j + l] + s[i][j] != l * l)
          break;
        if (RU[i + l - 1][j] >= l && TR[i][j + l - 1] >= l) {
          int cnt = 0;
          memset(res, 0, sizeof(res));
          for (int x = i; x < i + l; x++)
            for (int y = j; y < j + l; y++)
              if (mp[x][y] > 0) res[mp[x][y]] = 1;
          for (int c = 1; c <= n; c++) cnt += res[c];
          printf("YES %d\n", cnt);
          for (int c = 1; c <= n; c++)
            if (res[c]) printf("%d ", c);
          printf("\n");
          return 0;
        }
      }
    }
  printf("NO\n");
  return 0;
}
