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>
#pragma GCC optimize("O3")
using namespace std;
inline long long getint() {
  long long _x = 0, _tmp = 1;
  char _tc = getchar();
  while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
  if (_tc == '-') _tc = getchar(), _tmp = -1;
  while (_tc >= '0' && _tc <= '9') _x *= 10, _x += (_tc - '0'), _tc = getchar();
  return _x * _tmp;
}
inline long long add(long long _x, long long _y,
                     long long _mod = 1000000007LL) {
  _x += _y;
  return _x >= _mod ? _x - _mod : _x;
}
inline long long sub(long long _x, long long _y,
                     long long _mod = 1000000007LL) {
  _x -= _y;
  return _x < 0 ? _x + _mod : _x;
}
inline long long mul(long long _x, long long _y,
                     long long _mod = 1000000007LL) {
  _x *= _y;
  return _x >= _mod ? _x % _mod : _x;
}
long long mypow(long long _a, long long _x, long long _mod) {
  if (_x == 0) return 1LL;
  long long _ret = mypow(mul(_a, _a, _mod), _x >> 1, _mod);
  if (_x & 1) _ret = mul(_ret, _a, _mod);
  return _ret;
}
long long mymul(long long _a, long long _x, long long _mod) {
  if (_x == 0) return 0LL;
  long long _ret = mymul(add(_a, _a, _mod), _x >> 1, _mod);
  if (_x & 1) _ret = add(_ret, _a, _mod);
  return _ret;
}
inline bool equal(double _x, double _y) {
  return _x > _y - 1e-9 && _x < _y + 1e-9;
}
void sleep(double sec = 1021) {
  clock_t s = clock();
  while (clock() - s < CLOCKS_PER_SEC * sec)
    ;
}
int __ = 1, _cs;
void build() {}
long long n, k, v;
long long a[5050];
void init() {
  n = getint();
  k = getint();
  v = getint();
  for (int i = 0; i < n; i++) a[i] = getint();
}
void no() {
  puts("NO");
  exit(0);
}
vector<tuple<long long, long long, long long> > va;
bool ok[5050][5050][2];
int bk[5050][5050][2];
int cand[5050], ct;
int other[5050], ot;
void output() {
  puts("YES");
  for (auto i : va)
    printf("%lld %lld %lld\n", get<0>(i), get<1>(i) + 1, get<2>(i) + 1);
  exit(0);
}
void construct() {
  int master = cand[0];
  for (int _ = 1; _ < ct; _++) {
    int i = cand[_];
    va.push_back(make_tuple(1e6, i, master));
    a[master] += a[i];
  }
  for (int _ = 1; _ < ot; _++) {
    int i = other[_];
    va.push_back(make_tuple(1e6, i, other[0]));
    a[other[0]] += a[i];
  }
  if (a[master] > v) {
    long long dlt = (a[master] - v) / k;
    va.push_back(make_tuple(dlt, master, master == n - 1 ? 0 : master + 1));
  }
  if (a[master] < v) {
    long long nd = (v - a[master]) / k;
    if (ot == 0) no();
    if (a[other[0]] < nd * k) no();
    va.push_back(make_tuple(nd, other[0], master));
  }
  output();
}
void solve() {
  if (accumulate(a, a + n, 0LL) < v) no();
  if (v % k == 0) {
    for (int i = 1; i < n; i++) va.push_back(make_tuple(1e6, i, 0));
    if (v / k > 0) va.push_back(make_tuple(v / k, 0, 1));
    output();
  }
  ok[0][0][0] = true;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < k; j++)
      for (int gt = 0; gt < 2; gt++)
        if (ok[i][j][gt]) {
          ok[i + 1][j][gt] = true;
          bk[i + 1][j][gt] = (j << 1) | gt;
          ok[i + 1][(j + a[i]) % k][1] = true;
          bk[i + 1][(j + a[i]) % k][1] = (j << 1) | gt;
        }
  if (not ok[n][v % k][1]) no();
  int now = v % k, ngt = 1;
  for (int i = n; i; i--) {
    int pre = bk[i][now][ngt];
    if (((pre >> 1) + a[i - 1]) % k == now)
      cand[ct++] = i - 1;
    else
      other[ot++] = i - 1;
    now = pre >> 1;
    ngt = pre & 1;
  }
  assert(ct > 0);
  construct();
}
int main() {
  build();
  while (__--) {
    init();
    solve();
  }
}