Problem: Graph constructive problems are back! This time the graph you are asked to build should match the following properties.

The graph is connected if and only if there exists a path between every pair of vertices.

The diameter (aka "longest shortest path") of a connected undirected graph is the maximum number of edges in the shortest path between any pair of its vertices.

The degree of a vertex is the number of edges incident to it.

Given a sequence of n integers a_1, a_2, ..., a_n construct a connected undirected graph of n vertices such that:

  * the graph contains no self-loops and no multiple edges; 
  * the degree d_i of the i-th vertex doesn't exceed a_i (i.e. d_i ≤ a_i); 
  * the diameter of the graph is maximum possible. 



Output the resulting graph or report that no solution exists.

Input

The first line contains a single integer n (3 ≤ n ≤ 500) — the number of vertices in the graph.

The second line contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ n - 1) — the upper limits to vertex degrees.

Output

Print "NO" if no graph can be constructed under the given conditions.

Otherwise print "YES" and the diameter of the resulting graph in the first line.

The second line should contain a single integer m — the number of edges in the resulting graph.

The i-th of the next m lines should contain two integers v_i, u_i (1 ≤ v_i, u_i ≤ n, v_i ≠ u_i) — the description of the i-th edge. The graph should contain no multiple edges — for each pair (x, y) you output, you should output no more pairs (x, y) or (y, x).

Examples

Input


3
2 2 2


Output


YES 2
2
1 2
2 3


Input


5
1 4 1 1 1


Output


YES 2
4
1 2
3 2
4 2
5 2


Input


3
1 1 1


Output


NO

Note

Here are the graphs for the first two example cases. Both have diameter of 2.

<image> d_1 = 1 ≤ a_1 = 2

d_2 = 2 ≤ a_2 = 2

d_3 = 1 ≤ a_3 = 2 

<image> d_1 = 1 ≤ a_1 = 1

d_2 = 4 ≤ a_2 = 4

d_3 = 1 ≤ a_3 = 1

d_4 = 1 ≤ a_4 = 1 

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.util.Vector;
import java.io.BufferedInputStream;
import java.util.Stack;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * @author khokharnikunj8
 */

public class Main {
    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                new Main().solve();
            }
        }, "1", 1 << 26).start();
    }

    void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DMaximumDiameterGraph solver = new DMaximumDiameterGraph();
        solver.solve(1, in, out);
        out.close();
    }

    static class DMaximumDiameterGraph {
        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int n = in.scanInt();
            int[] ai = new int[n + 1];
            for (int i = 1; i <= n; i++) ai[i] = in.scanInt();
            long total_edge = 0;
            for (int i = 1; i <= n; i++) {
                total_edge += ai[i];
            }
            if (total_edge % 2 != 0) {
                int max = 1;
                for (int i = 1; i <= n; i++) {
                    if (ai[max] < ai[i]) max = i;
                }
                if (ai[max] == 1) {
                    out.println("NO");
                    return;
                } else {
                    ai[max]--;
                }
            }
            if (total_edge < 2 * (n - 1)) {
                out.println("NO");
                return;
            }
            ArrayList<Integer> one = new ArrayList<>();
            for (int i = 1; i <= n; i++)
                if (ai[i] == 1) one.add(i);

            if (one.size() <= 2) {
                out.println("YES " + (n - 1));
                out.println(n - 1);
                int ff = (one.size() < 1 ? 1 : one.get(0));
                int f_temp = ff;
                int ll = (one.size() < 2 ? -1 : one.get(1));
                int tl = 0;
                for (int i = 1; i <= n; i++) {
                    if (i != f_temp && i != ll) {
                        out.println(ff + " " + i);
                        ff = i;
                        tl++;
                    }
                }
                if (ll != -1) {
                    tl++;
                    out.println(ff + " " + ll);
                }
                if (tl != n - 1) throw new RuntimeException("NO");
                return;
            }

            int[] from = new int[n - 1];
            int[] to = new int[n - 1];
            int tl = 0;
            int ff = one.get(0);
            int ll = one.get(1);
            int sz = 1;
            Stack<Integer> st = new Stack<>();
            for (int i = 2; i < one.size(); i++) st.add(one.get(i));
            for (int i = 1; i <= n; i++) {
                if (ai[i] != 1) {
                    sz++;
                    int counter = ai[i] - 2;
                    from[tl] = ff;
                    to[tl] = i;
                    tl++;
                    while (st.size() > 0 && counter-- > 0) {
                        from[tl] = i;
                        to[tl] = st.pop();
                        tl++;
                    }
                    ff = i;
                }
            }
            if (st.size() != 0) {
                out.println("NO");
                return;
            }
            from[tl] = ff;
            to[tl] = ll;
            tl++;

            out.println("YES " + sz);
            out.println(n - 1);
            for (int i = 0; i < n - 1; i++) out.println(from[i] + " " + to[i]);


        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public int scanInt() {
            int integer = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    integer *= 10;
                    integer += n - '0';
                    n = scan();
                }
            }
            return neg * integer;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}