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.math.BigInteger;
import java.text.DecimalFormat;
import java.util.*;
import java.io.*;




public class Main {
    private static final int MAX = 100*1000 + 10;
    private static ArrayList<Integer> [] G = new ArrayList[MAX];
    private static int [] A;
    private static boolean addEdge(int u,int v,Buffer b) {
        b.appendLine(u + " " + v);
        u--;v--;
        A[u] --; A[v]--;
        return A[u] >= 0 && A[v] >= 0;
    }

    public static void main(String[] args) throws Exception {
        IO io ;
        try {
            io = new IO("in.in", null);
        } catch (IOException e) {
            io = new IO(null, null);
        }
        int n = io.getNextInt();
        A = new int[n];
        for (int i = 0;i < n;i++)
            A[i] = io.getNextInt();
        ArrayList<Integer> ones = new ArrayList<>();
        ArrayList<Integer> nons = new ArrayList<>();
        for (int i = 0;i < n;i++) {
            if (A[i] == 1) ones.add(i+1);
            else nons.add(i+1);
        }
        if (nons.isEmpty()) io.println("NO");
        else {
            Collections.sort(nons, new Comparator<Integer>() {
                @Override
                public int compare(Integer o1, Integer o2) {
                    return A[o1-1] - A[o2-1];
                }
            });
            Collections.reverse(nons);
            Buffer b = new Buffer();
            b.append("YES ");
            int dia = nons.size()-1;
            if (ones.size() > 0) dia++;
            if (ones.size() > 1) dia++;
            b.appendLine("" + dia);
            b.appendLine("" + (nons.size()-1+ones.size()));
            boolean y = true;
            for (int i = 0;i + 1 < nons.size();i++)
                y &= addEdge(nons.get(i),nons.get(i+1),b);

            Queue<Integer> q = new LinkedList<>();
            q.add(nons.get(nons.size()-1));
            for (int i = 0;i + 1 < nons.size();i++) q.add(nons.get(i));
            for (int u : ones) {
                Integer v = null;
                while (!q.isEmpty()) {
                    v = q.poll();
                    if (A[v-1] > 0) break;
                }
                if (v == null) {
                    y = false;
                    break;
                }
                y &= addEdge(u ,v,b);
                q.add(v);
            }
            if (!y) {
                b.clear();
                b.appendLine("NO");
            }
            io.print(b.toString());
        }
        io.close();
    }
    private static final int onebillion7 = 1000000007;
}



class Buffer{
    ArrayList<Character> AS;
    public Buffer(){
        AS = new ArrayList<>();
    }
    public void append(String s){
        for (char c : s.toCharArray())
            AS.add(c);
    }
    public void appendLine(String s) {
        append(s);
        AS.add('\n');
    }
    public void clear(){
        AS.clear();
    }
    public String toString(){
        StringBuilder sb = new StringBuilder();
        for (char c : AS)
            sb.append(c);
        return sb.toString();
    }
}

class IO{
    private BufferedReader br;
    private StringTokenizer st;
    private PrintWriter writer;
    private String inputFile,outputFile;

    public boolean hasMore() throws IOException{
        if(st != null && st.hasMoreTokens()) return true;
        if(br != null && br.ready()) return true;
        return false;
    }

    public String getNext() throws FileNotFoundException, IOException{
        while(st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    public String getNextLine() throws FileNotFoundException, IOException{
        return br.readLine().trim();
    }

    public int getNextInt() throws FileNotFoundException, IOException{
        return Integer.parseInt(getNext());
    }
    public long getNextLong() throws FileNotFoundException, IOException{
        return Long.parseLong(getNext());
    }

    public void print(double x,int num_digits) throws  IOException{
        writer.printf("%." + num_digits + "f" ,x);
    }
    public void println(double x,int num_digits) throws  IOException{
        writer.printf("%." + num_digits + "f\n" ,x);
    }
    public void print(Object o) throws  IOException{
        writer.print(o.toString());
    }

    public void println(Object o) throws  IOException{
        writer.println(o.toString());
    }
    public IO(String x,String y) throws FileNotFoundException, IOException{
        inputFile = x;
        outputFile = y;
        if(x != null) br = new BufferedReader(new FileReader(inputFile));
        else br = new BufferedReader(new InputStreamReader(System.in));
        if(y != null) writer = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));
        else writer = new PrintWriter(new OutputStreamWriter(System.out));
    }

    protected void close() throws IOException{
        br.close();
        writer.close();
    }
    public void outputArr(Object [] A) throws IOException{
        int L = A.length;
        for (int i = 0;i < L;i++) {
            if(i > 0) writer.print(" ");
            writer.print(A[i]);
        }
        writer.print("\n");
    }
}