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.util.*;
import java.io.*; 
import java.text.*;
//Solution Credits: Taranpreet Singh
public class Main{
    //SOLUTION BEGIN
    void solve(int TC) throws Exception{
        int n = ni();
        int[] d = new int[1+n];int max = 0, sum = 0;
        for(int i = 1; i<= n; i++){
            d[i] = ni();
            sum+=d[i];
            max= Math.max(max, d[i]);
        }
        if(max==1 || sum<2*n-2)pn("NO");
        else{
//            pn("YES");
//            pn(n-1);
            TreeSet<Integer> set = new TreeSet<>();
            int p = 0;
            int[][] edge = new int[n-1][];int c = 0;
            for(int i = 1; i<= n; i++)if(d[i]==1)set.add(i);
            for(int i = 1; i<= n; i++){
                if(d[i]==1)continue;
                else{
                    if(p!=0){
                        edge[c++] = new int[]{p,i};
                        d[p]--;
                        d[i]--;
                    }
                    p = i;
                    while(d[i]>1 && set.size()>1){
                        edge[c++] = new int[]{i, set.pollFirst()};d[i]--;
                    }
                }
            }
            if(!set.isEmpty())edge[c++] = new int[]{p, set.pollFirst()};
            if(!set.isEmpty()){
                pn("NO");return;
            }
            pn("YES "+diameter(edge, n));
            pn(n-1);
            for(int[] i:edge)pn(i[0]+" " + i[1]);
        }
    }
    int diameter(int[][] edges, int n){
        int[] cnt = new int[n+1], g[] = new int[n+1][];
        for(int[] i:edges){
            cnt[i[0]]++;cnt[i[1]]++;
        }
        for(int i = 1; i<= n; i++)g[i] = new int[cnt[i]];
        for(int[] i:edges){
            g[i[0]][--cnt[i[0]]] = i[1];
            g[i[1]][--cnt[i[1]]] = i[0];
        }
        Queue<Integer> q = new LinkedList<>();
        q.add(1);
        int[] d = new int[n+1];
        Arrays.fill(d, INF);
        d[1] = 0;
        int x = 0;
        while(!q.isEmpty()){
            x = q.poll();
            for(int v:g[x])if(d[v]==INF){
                d[v] = d[x]+1;
                q.add(v);
            }
        }
        Arrays.fill(d, INF);
        d[x] = 0;
        q.add(x);int y = 0;
        while(!q.isEmpty()){
            y = q.poll();
            for(int v:g[y]){
                if(d[v]==INF){
                    d[v] = d[y]+1;
                    q.add(v);
                }
            }
        }
        return d[y];
    }
    int h(int[][] g, int[] h, int u, int p){
        for(int it: g[u]){
            if(it == p){
                continue;
            }
            h[u] = Math.max(h[u], h(g,h,it, u));
        }
        h[u] +=  1;
        return h[u];
    }
    int dfs(int[][] g, int[] d, int u, int p){
        int mx1 = -1, mx2 = -1, mx = -1;
        for(int v:g[u]){
            if(v==p)continue;
            mx = Math.max(mx, dfs(g, d, v, u));
            if(mx1<d[v]){
                mx2 = mx1;
                mx1 = d[v];
            }else mx2 = Math.max(mx2, d[v]);
        }
        return Math.max(mx, mx1+mx2+1);
    }
    //SOLUTION END
    long mod = (long)1e9+7, IINF = (long)5e18;
    final int INF = (int)2e9;
    DecimalFormat df = new DecimalFormat("0.000000000");
    double PI = 3.1415926535897932384626433832792884197169399375105820974944, eps = 1e-8;
    static boolean multipleTC = false, memory = false;
    FastReader in;PrintWriter out;
    void run() throws Exception{
        in = new FastReader();
        out = new PrintWriter(System.out);
        int T = (multipleTC)?ni():1;
        //Solution Credits: Taranpreet Singh
        for(int i = 1; i<= T; i++)solve(i);
        out.flush();
        out.close();
    }
    public static void main(String[] args) throws Exception{
        if(memory)new Thread(null, new Runnable() {public void run(){try{new Main().run();}catch(Exception e){e.printStackTrace();}}}, "1", 1 << 28).start();
        else new Main().run();
    }
    long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
    int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
    int bit(long n){return (n==0)?0:(1+bit(n&(n-1)));}
    void p(Object o){out.print(o);}
    void pn(Object o){out.println(o);}
    void pni(Object o){out.println(o);out.flush();}
    String n(){return in.next();}
    String nln(){return in.nextLine();}
    int ni(){return Integer.parseInt(in.next());}
    long nl(){return Long.parseLong(in.next());}
    double nd(){return Double.parseDouble(in.next());}

    class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws Exception{
            br = new BufferedReader(new FileReader(s));
        }

        String next(){
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException  e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine(){
            String str = "";
            try{    
                str = br.readLine();
            }catch (IOException e){
                e.printStackTrace();
            }   
            return str;
        }
    }
}