#include #include #include #define rep(E, F) for (E = 0; E < (F); E++) int max(int a, int b) { if (a < b) return b; return a; } int get_int(); int main() { int i, j, n = get_int(), t = 0, s = 0, r, x, y; int a[n]; rep(i, n) t += a[i] = get_int(); rep(i, n) s = max(s, a[i]); rep(i, n) if (s == a[i]) break; r = i; t -= s; if ((t + s)%2 == 1 || s > t) { printf("NO\n"); return 0; } printf("YES\n"); x = y = 0; while (s != t) { while (a[x] == 0 || x == y || x == r) x++; a[x]--; while (a[y] == 0 || x == y || y == r) y++; a[y]--; printf("%d %d\n", x + 1, y + 1); t -= 2; } x = 0; while (t != 0) { while (a[x] == 0 || x == r) x++; printf("%d %d\n", r + 1, x + 1); a[x]--; t -= 1; } return 0; } int get_int() { int ret = 0; char c = getchar(); int sgn; while (1) { if (c == EOF) return EOF; if (c >= '0' && c <= '9') { sgn = 1; break; } if (c == '-') { c = getchar(); if (c < '0' || c > '9') continue; sgn = -1; break; } c = getchar(); } while (1) { ret = ret*10 + c - '0'; c = getchar(); if (c < '0' || c > '9') return sgn*ret; } }