#include <bits/stdc++.h>
using namespace std;
int a[10000], f[10000];
bool use[10000];
int main() {
  int n, k, v;
  cin >> n >> k >> v;
  int tot = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    tot += a[i];
  }
  if (tot < v) {
    cout << "NO" << endl;
    return 0;
  }
  f[0] = -1;
  bool tf = false;
  int start, l1, l2, cur;
  if (v % k == 0) {
    cout << "YES" << endl;
    for (int i = 1; i < n; i++)
      if (a[i] > 0) cout << (a[i] - 1) / k + 1 << " " << i << " " << n << endl;
    if (v > 0) cout << v / k << " " << n << " " << 1 << endl;
    return 0;
  }
  for (int i = 1; !tf && i <= n; i++)
    for (int j = k - 1; !tf && j >= 0; j--)
      if (f[j] != 0 && f[j] < i) {
        if ((j + a[i] - v) % k == 0) {
          use[i] = true;
          cur = a[i];
          l1 = i;
          start = ((v - a[i]) % k + k) % k;
          tf = true;
          break;
        }
        if (f[(j + a[i]) % k] == 0) f[(j + a[i]) % k] = i;
      }
  if (!tf) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  while (start != 0) {
    use[f[start]] = true;
    cur += a[f[start]];
    start = ((start - a[f[start]]) % k + k) % k;
  }
  l2 = l1 % n + 1;
  for (int i = 1; i <= n; i++)
    if (!use[i]) {
      l2 = i;
      break;
    }
  for (int i = 1; i <= n; i++) {
    if (use[i] && (i != l1))
      cout << (a[i] - 1) / k + 1 << " " << i << " " << l1 << endl;
    if (!use[i] && (i != l2))
      cout << (a[i] - 1) / k + 1 << " " << i << " " << l2 << endl;
  }
  if (cur < v)
    cout << (v - cur) / k << " " << l2 << " " << l1 << endl;
  else if (cur > v)
    cout << (cur - v) / k << " " << l1 << " " << l2 << endl;
}
