Problem: Petya sometimes has to water his field. To water the field, Petya needs a tank with exactly V ml of water.

Petya has got N tanks, i-th of them initially containing ai ml of water. The tanks are really large, any of them can contain any amount of water (no matter how large this amount is).

Also Petya has got a scoop that can contain up to K ml of water (initially the scoop is empty). This scoop can be used to get some water from some tank, and after that pour it all into some tank (it is impossible to get water from multiple tanks without pouring it, or leave some water in the scoop when pouring it). When Petya tries to get some water from a tank, he gets min(v, K) water, where v is the current volume of water in the tank.

Is it possible to obtain a tank with exactly V ml of water using these operations? If it is possible, print a sequence of operations that allows to do it. If there are multiple ways to obtain needed amount of water in some tank, print any of them.

Input

The first line contains 3 integers: N (2 ≤ N ≤ 5000), K (1 ≤ K ≤ 5000), and V (0 ≤ V ≤ 109) — the number of tanks, the maximum volume of water the scoop can contain, and the required amount of water in some tank, respectively.

The second line contains N integers ai (0 ≤ ai ≤ 105), where ai is initial volume of water in i-th tank.

Output

If it is impossible to obtain a tank with exactly V ml of water, print NO. 

Otherwise print YES in the first line, and beginning from the second line, print the sequence of operations in the following format: 

Each line has to contain 3 numbers denoting a compressed operation: "cnt x y" (1 ≤ cnt ≤ 109, 1 ≤ x, y ≤ N), where x is the index of the tank where we get water, y is the index of the tank where we pour water, and cnt is the number of times we transfer water from tank x to tank y. 

The number of these lines must not exceed N + 5.

Examples

Input

2 3 5
2 3


Output

YES
1 2 1


Input

2 3 4
2 3


Output

NO


Input

5 2 0
1 3 5 7 9


Output

YES
2 2 1
3 3 1
4 4 1
5 5 1

Solution (in JAVA):

Solution:
// Working program using Scanner
import java.io.*;
import java.util.*;
import java.math.*;
public class codeforce{
    public static void merge(int[] l,int[] r,int[] a) {

			int i=0,j=0,k=0;
			int nl = l.length;
			int nr = r.length;
			while(i<nl && j<nr) {
				if(l[i]<r[j]) {
					a[k] = l[i];
					i++;
				}
				else {
					a[k] = r[j];
					j++;
				}
				k++;
			}
			while(i<nl) {
				a[k] = l[i];
				i++;
				k++;
			}
			while(j<nr) {
				a[k] = r[j];
				j++;
				k++;
			}
		}
		
		public static void mergesort(int[] a) {
			int n = a.length;
			if(n==1) {}
			else {
				int nl = n/2;
				int nr = n-nl;
				int[] l = new int[nl];
				int[] r = new int[nr];
				for(int i=0;i<nl;i++) l[i] = a[i];
				for(int i=nl;i<n;i++) r[i-nl] = a[i];
				mergesort(l);
				mergesort(r);
				merge(l,r,a);
			}
		}

    public static void makeitreal(int[] t4,int[] t3,int l,int r){
        int[] t = new int[l];
        for(int i=0;i<l;i++) t[i] = t3[i];
        mergesort(t);
        int n=0;
        for(int i=1;i<l;i++){
            for(int j=t[i-1]+1;j<t[i];j++){
                t4[n] = j;
                n++;
            }
        }
        for(int j=t[l-1]+1;j<r;j++){
            t4[n] = j;
            n++;
        }
    }
    public static String summ(int d,int v,int[] t1,int k,int sum){
        String s = new String();
        if((sum+t1[d])%k==v%k){
            return s.valueOf(d);
        } 
        if(d==t1.length-1) return null;
        for(int i=d+1;i<t1.length;i++){
            s = summ(i,v,t1,k,sum+t1[d]);
            if(s!=null) break;
        }
        if(s==null) return null;
        s = s.valueOf(d)+" "+s;
        return s;
    }
    public static String getSum(int v,int[] t1,int k){
        String s = new String();
        if(t1.length>25) {
            int[] t = new int[25];
            for(int i=0;i<25;i++) t[i] = t1[i];
            for(int i=0;i<25;i++){
                s = summ(i,v,t,k,0);
                if(s!=null) break;
            }
        }else{
            for(int i=0;i<t1.length;i++){
                s = summ(i,v,t1,k,0);
                if(s!=null) break;
            }
        }
        return s;
        
    }
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int n  = sc.nextInt();
        int k = sc.nextInt();
        int v = sc.nextInt();
        int[] a = new int[n];
        int[] t1 = new int[n];
        int[] t2 = new int[n];
        for(int i=0;i<n;i++){
            a[i] = sc.nextInt();
            t1[i] = a[i]%k;
            t2[i] = a[i]/k;
        }
        int[] t3 = new int[n];
        String ss = getSum(v,t1,k);
        
        int l=1;
        if(ss==null) l = 0;
        //s = "0 1 2 6 17"
        else{
            for(int i=0;i<ss.length();i++) if(ss.charAt(i)==' ') l++;
            StringTokenizer st = new StringTokenizer(ss);
            for(int i=0;i<l;i++) t3[i] = Integer.parseInt(st.nextToken());
        }
        
        
        
        
        
        if(l==0){
            if(v==0){
                System.out.println("YES");
                if(t1[0]!=0) t2[0]++;
                System.out.println(t2[0]+" 1 2");
            }
            else if(v%k==0){
                int s = 0;
                for(int i=0;i<n;i++){
                    s += a[i];
                }
                if(s>=v){
                    System.out.println("YES");
                    for(int i=0;i<n-1;i++){
                        if(t1[i]!=0) t2[i]++;
                        System.out.println(t2[i]+" "+(i+1)+" "+n);
                    }
                    s = v/k;
                    System.out.println(s+" "+n+" 1");
                }else{
                    System.out.println("NO");
                }
            }else{
                System.out.println("NO");
            }
        }else{
            int s =0;
            for(int i=0;i<l;i++){
                s += a[t3[i]];
            }
            int[] t4 = new int[n-l];
            makeitreal(t4,t3,l,n);//yamla o t4 bil9iam l o5ara;
            int p = 0;
            for(int i=0;i<n-l;i++){
                p += a[t4[i]];
            }
            if(s+p-p%k<v) System.out.println("NO");
            else{
                System.out.println("YES");
                for(int i=1;i<l;i++){
                    if(t1[t3[i]]!=0) t2[t3[i]]++;
                    if(t2[t3[i]]!=0) System.out.println(t2[t3[i]]+" "+(t3[i]+1)+" "+(t3[0]+1));
                }
                if(s<v){
                    for(int i=1;i<n-l;i++){
                        if(t1[t4[i]]!=0) t2[t4[i]]++;
                        if(t2[t4[i]]!=0) System.out.println(t2[t4[i]]+" "+(t4[i]+1)+" "+(t4[0]+1));
                    }
                    s = v-s;
                    if(s/k!=0) System.out.println(s/k+" "+(t4[0]+1)+" "+(t3[0]+1));
                }else if(s>v){
                    s = s-v;
                    int j=0;
                    if(t3[0]==0) j=1;
                    if(s/k!=0) System.out.println(s/k+" "+(t3[0]+1)+" "+(j+1));
                }
            }
        }
    }
}