#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 5;
const int INF = 1e9 + 7;
int n, k, v, a[N], f[N][N], trace[N][N];
bool C[N];
void THDB() {
  cout << "YES\n";
  for (int i = 2; i <= n; i++) {
    if (a[i] / k) cout << a[i] / k << " " << i << " " << 1 << endl;
    if (a[i] % k) cout << 1 << " " << i << " " << 1 << endl;
  }
  exit(0);
}
inline void pour(int x, int y) {
  if (a[x] % k) {
    cout << a[x] / k + 1 << " " << x << " " << y << endl;
  } else if (a[x] / k)
    cout << a[x] / k << " " << x << " " << y << endl;
  a[y] += a[x];
  a[x] = 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k >> v;
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (!v) THDB();
  if (sum < v) cout << "NO", exit(0);
  memset(f, false, sizeof f);
  f[0][0] = true;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < k; j++)
      if (f[i - 1][(j - (a[i] % k) + k) % k]) {
        f[i][j] = true;
        trace[i][j] = 1;
      } else if (f[i - 1][j]) {
        f[i][j] = true;
        trace[i][j] = 2;
      }
  if (f[n][v % k] == false) cout << "NO", exit(0);
  int cur = v % k;
  memset(C, false, sizeof C);
  for (int i = n; i >= 1; i--)
    if (trace[i][cur] == 1) {
      cur = (cur - (a[i] % k) + k) % k;
      C[i] = true;
    }
  cout << "YES\n";
  int pos = -1;
  for (int i = 1; i <= n; i++)
    if (C[i]) {
      pos = i;
      break;
    }
  if (pos == -1) {
    pour(1, 2);
    pos = 1;
  }
  int R = -1;
  for (int i = 1; i <= n; i++)
    if (i != pos) R = i;
  for (int i = 1; i <= n; i++)
    if (C[i] && i != pos) pour(i, pos);
  for (int i = 1; i <= n; i++)
    if (!C[i] && i != R) pour(i, R);
  if (a[pos] < v)
    cout << (v - a[pos]) / k << " " << R << " " << pos << endl;
  else if (a[pos] > v)
    cout << (a[pos] - v) / k << " " << pos << " " << R << endl;
  return 0;
}
