#include <bits/stdc++.h>
using namespace std;
const int N = 5050;
int n, k, v, tot;
int dp[N], a[N];
bool f[N];
int main() {
  cin >> n >> k >> v;
  dp[0] = n + 1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    tot += a[i];
    for (int j = 0; j < k; j++)
      if (dp[j] && (dp[j] != i) && dp[(j + a[i]) % k] == 0)
        dp[(j + a[i]) % k] = i;
  }
  if (tot < v || dp[v % k] == 0) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  int md = v % k;
  int pp = 0;
  int np = 0;
  while (md > 0) {
    f[dp[md]] = true;
    md = (md - a[dp[md]] % k + k) % k;
  }
  for (int i = 1; i <= n; i++)
    if (f[i])
      pp = i;
    else
      np = i;
  for (int i = 1; i <= n; i++)
    if (f[i] && (i != pp)) {
      if (a[i] == 0) continue;
      cout << a[i] << " " << i << " " << pp << endl;
      a[pp] += a[i];
    }
  for (int i = 1; i <= n; i++)
    if ((!f[i]) && (i != np)) {
      if (a[i] == 0) continue;
      cout << a[i] << " " << i << " " << np << endl;
      a[np] += a[i];
    }
  if (!pp) {
    if (v > 0) cout << v / k << " " << np << " " << np % n + 1 << endl;
    return 0;
  }
  if (a[pp] > v) {
    cout << (a[pp] - v) / k << " " << pp << " " << pp % n + 1 << endl;
    return 0;
  }
  if (a[pp] < v) {
    cout << (v - a[pp]) / k << " " << np << " " << pp << endl;
    return 0;
  }
  return 0;
}
