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.util.Arrays;
import java.util.Scanner;

public class d {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int k = in.nextInt();
		int v = in.nextInt();
		
		int tar = v%k;
		int tot = 0;
		
		
		
		int[] water = new int[n];
		for(int i=0; i<n; i++) {
			int a = in.nextInt();
			tot += a;
			
			water[i] = a;
		}
		
		// Silly base case
		if(v == 0) {
			int mv = (water[0]/k + ((water[0]%k == 0 ? 0 : 1)));
			System.out.println("YES");
			if(mv != 0)
				System.out.println(mv+" 1 2");
			
			return;
		}
		
		// Compute ways we can reach every value under mod k
		int[] path = canMake(water, k);

//		for(int i=0; i<k; i++) {
//			System.out.print(path[i]+" ");
//		}
//		System.out.println();
		
		if(path[tar] == -1 || tot < v) {
			System.out.println("NO");
			return;
		}
		
		System.out.println("YES");
		
		moved = new boolean[n];
		s = -1;
		printPath(water, path, tar, k);
		if(s == -1) {
			s = 0;
			int cnt = (water[0]/k + ((water[0]%k == 0 ? 0 : 1)));
			System.out.println(cnt+" 1 2");
			
			water[1] += water[0];
			water[0] = 0;
		}
		
		// Move the water around to get that mod stuff worked out
//		printPath(water, path, tar, tar);
//		
		int mv = v-water[s];
		
		if(mv > 0) {
			int fill = s == 0 ? 1 : 0;
			for(int i=0; i<n; i++) {
				if(i == fill || i == s) continue;
				
				int cnt = (water[i]/k + ((water[i]%k == 0 ? 0 : 1)));
				if(cnt > 0 && !moved[i])
					System.out.println(cnt+" "+(i+1)+" "+(fill+1));
				water[fill] += water[i];
			}
			
			System.out.println((mv/k)+" "+(fill+1)+" "+(s+1));
		}
		
		else {
			int fill = s == 0 ? 1 : 0;
			if(mv != 0) System.out.println((-mv/k)+" "+(s+1)+" "+(fill+1));
		}

	}
	
	static int[] canMake(int[] nums, int k) {
		int[] ret = new int[k];
		Arrays.fill(ret, -1);
		
		ret[0] = -2;
//		for(int i=0; i<nums.length; i++) {
//			ret[nums[i]%k] = i;
//			System.out.println(i+": "+i+" <-- "+(nums[i]%k));
//		}
		
		for(int i=0; i<nums.length; i++) {
			for(int j=k; j>= 0; j--) {
				int val = j-nums[i];
				while(val < 0) val+=k;
				val = val%k;
				
//				System.out.println("I: "+i+" J: "+j+" V: "+val);
				if((ret[val] != -1 && ret[val] != i && ret[j%k] == -1)) {
//					System.out.println("SET "+(j%k)+" TO "+i+" WAS "+ret[j%k]);
					ret[j%k] = i;
				}
			}
		}
		
		return ret;
	}
	
	static boolean[] moved;
	static int s;
	static void printPath(int[] water, int[] p, int c, int k) {
		
		if(c == 0) return;
		if(s == -1) s = p[c];
		
		int next = c - water[p[c]];
		while(next < 0) next += k;
		
		moved[p[c]] = true;
		printPath(water, p, next, k);

		int cnt = ( water[p[c]]/k + ((water[p[c]]%k == 0 ? 0 : 1)));
		if(s != p[c]) {
			System.out.println(cnt+" "+(p[c]+1)+" "+(s+1));
			water[s] += water[p[c]];
			water[p[c]] = 0;
		}
	}

}

/*
5 4 10
1
20
18
5
0

5 4 10
1
20
2
5
0

5 4 10
1
20
6
5
0

5 4 10
1
20
10
5
0

5 4 10
1
1
1
2
5

10 4 10
1
1
1
1
1
1
1
1
1
1

3 3 3
1
1
1

 */