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;
const int MAXN = 5002;
const int INF = 1000000007;
const double PI = acos(-1.0);
int f[MAXN][MAXN], x[MAXN], y[MAXN];
bool g[MAXN][MAXN];
bool z[MAXN];
struct node {
  int a, b, c;
  node() {}
  node(int _a, int _b, int _c) : a(_a), b(_b), c(_c) {}
};
int VK0(int N, int K, int V) {
  vector<node> ans;
  for (int i = 1; i < N; ++i) {
    ans.push_back(node(y[i] + 1, i + 1, 1));
    x[0] += x[i];
    y[0] += y[i];
  }
  y[0] += x[0] / K;
  x[0] %= K;
  if (y[0] < V / K) {
    cout << "NO" << endl;
    return 0;
  }
  if (V / K > 0) ans.push_back(node(V / K, 1, 2));
  cout << "YES" << endl;
  for (int i = 0; i < ans.size(); ++i)
    cout << ans[i].a << " " << ans[i].b << " " << ans[i].c << endl;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  int N, K, V;
  cin >> N >> K >> V;
  int sum = 0;
  for (int i = 0; i < N; ++i) {
    cin >> x[i];
    y[i] += x[i] / K;
    x[i] %= K;
    sum += y[i];
  }
  if (V % K == 0) return VK0(N, K, V);
  g[0][0] = true;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < K; ++j) {
      g[i + 1][j] = g[i][j];
      f[i + 1][j] = -1;
    }
    if (x[i] == 0) continue;
    for (int j = 0; j < K; ++j) {
      if (!g[i][j]) continue;
      g[i + 1][(j + x[i]) % K] = true;
      f[i + 1][(j + x[i]) % K] = i;
    }
  }
  if (!g[N][V % K]) {
    cout << "NO" << endl;
    return 0;
  }
  int a = N, b = V % K;
  vector<int> X;
  while (a != 0) {
    if (f[a][b] == -1) {
      --a;
      continue;
    }
    X.push_back(f[a][b]);
    b = (b + K - x[f[a][b]]) % K;
    --a;
  }
  vector<node> ansT;
  sort(X.begin(), X.end());
  a = X[0];
  z[a] = true;
  for (int i = 1; i < X.size(); ++i) {
    int b = X[i];
    z[b] = true;
    x[a] += x[b];
    y[a] += y[b];
    ansT.push_back(node(y[b] + 1, b + 1, a + 1));
    x[b] = y[b] = 0;
  }
  b = (a + 1) % N;
  for (int i = 0; i < N; ++i) {
    if (!z[i] && i != b) {
      ansT.push_back(node(y[i] + 1, i + 1, b + 1));
      x[b] += x[i];
      y[b] += y[i];
      x[i] = y[i] = 0;
    }
  }
  y[a] += x[a] / K;
  x[a] %= K;
  y[b] += x[b] / K;
  y[b] %= K;
  if (y[a] < V / K) {
    if (y[a] + y[b] < V / K) {
      cout << "NO" << endl;
      return 0;
    }
    ansT.push_back(node(V / K - y[a], b + 1, a + 1));
  } else if (y[a] > V / K) {
    ansT.push_back(node(y[a] - V / K, a + 1, b + 1));
  }
  cout << "YES" << endl;
  for (int i = 0; i < ansT.size(); ++i)
    cout << ansT[i].a << " " << ansT[i].b << " " << ansT[i].c << endl;
  return 0;
}