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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <typename T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T, class T1>
inline void gn(T &first, T1 &second) {
  gn(first);
  gn(second);
}
template <class T, class T1, class T2>
inline void gn(T &first, T1 &second, T2 &z) {
  gn(first);
  gn(second);
  gn(z);
}
template <typename T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
template <typename T>
inline void println(T first) {
  print(first), putchar('\n');
}
template <typename T>
inline void printsp(T first) {
  print(first), putchar(' ');
}
template <class T, class T1>
inline void print(T first, T1 second) {
  printsp(first), println(second);
}
template <class T, class T1, class T2>
inline void print(T first, T1 second, T2 z) {
  printsp(first), printsp(second), println(z);
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
int a[5050], vst[5050];
bool can[5050][5050], used[5050][5050];
int main() {
  int n, K, V;
  gn(n, K, V);
  int sum = 0;
  for (int i = 1; i <= n; i++) gn(a[i]), sum += a[i];
  if (sum < V) return puts("NO"), 0;
  if (V % K == 0) {
    puts("YES");
    for (int i = 2; i <= n; i++) print(1000000000, i, 1);
    if (V) print(V / K, 1, n);
    return 0;
  }
  can[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    int r = a[i] % K;
    for (int j = 0; j < K; j++) {
      if (can[i - 1][j]) can[i][j] = 1;
    }
    for (int j = 0; j < K; j++) {
      if (can[i - 1][j] && !can[i][(j + r) % K])
        can[i][(j + r) % K] = used[i][(j + r) % K] = 1;
    }
  }
  if (!can[n][V % K]) return puts("NO"), 0;
  puts("YES");
  int p = 0, ss = 0;
  for (int i = n, r = V % K; i; i--) {
    if (used[i][r]) vst[i] = 1, r = (K + r - a[i] % K) % K, p = i, ss += a[i];
  }
  for (int i = 1; i <= n; i++)
    if (vst[i] && i != p) {
      print(1000000000, i, p);
    }
  if (ss < V) {
    int q = (p == 1 ? 2 : 1);
    for (int i = 1; i <= n; i++)
      if (!vst[i] && i != q) {
        print(1000000000, i, q);
      }
    print((V - ss) / K, q, p);
  } else if (ss > V) {
    int q = (p == 1 ? 2 : 1);
    print((ss - V) / K, p, q);
  }
  return 0;
}