#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int maxk = 5003;
int n, k, v;
ll a[maxk];
void pour(ll cnt, int x, int y) {
  cout << cnt << ' ' << x + 1 << ' ' << y + 1 << '\n';
  int amt = min(a[x], k * cnt);
  a[x] -= amt;
  a[y] += amt;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k >> v;
  ll tot = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    tot += a[i];
  }
  bool poss[maxk] = {};
  pair<int, int> pre[maxk];
  poss[0] = true;
  for (int i = 0; i < n; i++) {
    bool temp[maxk] = {};
    for (int j = 0; j < k; j++) {
      if (poss[j]) {
        int p = (j + a[i]) % k;
        if (!poss[p]) {
          temp[p] = true;
          pre[p] = {j, i};
        }
      }
    }
    for (int j = 0; j < k; j++) {
      poss[j] |= temp[j];
    }
  }
  if (poss[v % k] && tot >= v) {
    cout << "YES\n";
    int inf = 1e9;
    int p = v % k;
    int ind;
    if (v % k == 0) {
      ind = 0;
      pour(inf, 0, 1);
    } else {
      vector<int> l;
      while (p != 0) {
        l.push_back(pre[p].second);
        p = pre[p].first;
      }
      ind = l[0];
      for (int i = 1; i < l.size(); i++) {
        pour(inf, l[i], ind);
      }
    }
    int nxt = (ind + 1) % n;
    if (a[ind] > v) {
      pour((a[ind] - v) / k, ind, nxt);
    } else if (a[ind] < v) {
      for (int i = 0; i < n; i++) {
        if (i != ind && i != nxt) {
          pour(inf, i, nxt);
        }
      }
      pour((v - a[ind]) / k, nxt, ind);
    }
  } else {
    cout << "NO\n";
  }
  return 0;
}
