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:
import java.io.*;
import java.util.*;

public class Main{
	static int n,k,v,vmodk,in[];
	static Boolean[][]memo;
	static boolean dp(int i,int mod) {
		if(i>=n)return mod==vmodk;
		if(memo[i][mod]!=null)return memo[i][mod];
		
		if(mod==vmodk)return memo[i][mod]=true;
		return memo[i][mod]=dp(i+1, (mod+in[i])%k)||dp(i+1, mod);
	}
	static LinkedList<Integer>list;
	static void trace(int i,int mod) {
		if(i>=n)return;
		if(mod==vmodk) {
			return;
		}
		if(dp(i+1, (mod+in[i])%k)) {
			list.add(i);
			trace(i+1, (mod+in[i])%k);
			return;
		}
		trace(i+1, mod);
	}
   	static void main() throws Exception{
   		n=sc.nextInt();k=sc.nextInt();v=sc.nextInt();
   		vmodk=v%k;
   		in=sc.intArr(n);
   		long sum=0;
   		for(int i=0;i<n;i++)sum+=in[i];
   		memo=new Boolean[n][k];
   		if(sum<v || !dp(0, 0)) {
   			pw.println("NO");
   			return;
   		}
   		pw.println("YES");
   		if(vmodk==0) {
   			int pour=0;
   			for(int i=1;i<n;i++) {
   				int amount=(in[i]+k-1)/k;
   				if(amount==0)continue;
   	   			pw.println((amount)+" "+(i+1)+" "+(pour+1));
   			}
   			int need=v/k;
   			if(need==0)return;
   			pw.println(need+" "+(pour+1)+" "+2);
   			return;
   		}
   		
   		
   		list=new LinkedList<>();
   		trace(0, 0);
   		boolean[]taken=new boolean[n];
   		int pour=list.poll();
   		taken[pour]=true;
   		sum=in[pour];
   		int other=-1;
   		while(!list.isEmpty()) {
   			other=list.poll();
   			taken[other]=true;
   			sum+=in[other];
   			int amount=(in[other]+k-1)/k;
   			if(amount==0)continue;
   			pw.println((amount)+" "+(other+1)+" "+(pour+1));
   		}
   		if(sum>=v) {
   			if(other==-1) {
   				for(int i=0;i<n;i++) {
   					if(!taken[i]) {
   						other=i;break;
   					}
   				}
   			}
   			long need=(sum-v+k-1)/k;
   			if(need==0)return;
   			pw.println(need+" "+(pour+1)+" "+(other+1));
   			return;
   		}
   		int tmpPour=-1;
   		for(int i=0;i<n;i++) {
   			if(!taken[i]) {
   				tmpPour=i;
   				taken[i]=true;
   				break;
   			}
   		}
   		for(int i=0;i<n;i++) {
   			if(!taken[i]) {
   				int amount=(in[i]+k-1)/k;
   				if(amount==0)continue;
   				pw.println(amount+" "+(i+1)+" "+(tmpPour+1));
   			}
   		}
   		long need=(v-sum+k-1)/k;
   		pw.println(need+" "+(tmpPour+1)+" "+(pour+1));
	}
	public static void main(String[] args) throws Exception{
		pw=new PrintWriter(System.out);
		sc = new MScanner(System.in);
//		int tc=sc.nextInt();
//		while(tc-->0)
			main();
		pw.flush();
	}
	static PrintWriter pw;
	static MScanner  sc;
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] intArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] longArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public int[] intSortedArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public long[] longSortedArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public Integer[] IntegerArr(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] LongArr(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
	static void shuffle(int[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			int tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
	static void shuffle(long[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			long tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
}