#include <bits/stdc++.h>
using namespace std;
void solve() {
  int N, K, V;
  cin >> N >> K >> V;
  vector<int> x(N);
  for (int i = 0; i < N; i++) cin >> x[i];
  int total = accumulate((x).begin(), (x).end(), 0);
  if (total < V) {
    cout << "NO";
    return;
  }
  vector<vector<bool>> can(N + 1, vector<bool>(K, 0));
  can[0][0] = 1;
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j < K; j++) {
      can[i][j] = (can[i - 1][j] | can[i - 1][(j - (x[i - 1] % K) + K) % K]);
    }
  }
  if (!can[N][V % K]) {
    cout << "NO";
    return;
  }
  vector<int> touse, tonotuse;
  int tousesum = 0, tonotusesum = 0;
  int curx = N, cury = V % K;
  while (curx) {
    if (can[curx - 1][cury]) {
      tonotuse.emplace_back(curx);
      tonotusesum += x[curx - 1];
      curx--;
    } else {
      touse.emplace_back(curx);
      tousesum += x[curx - 1];
      cury = (cury - x[curx - 1] % K + K) % K;
      curx--;
    }
  }
  assert(!(curx + cury));
  assert(tousesum % K == V % K);
  cout << "YES\n";
  for (int i = 1; i < (int)touse.size(); i++) {
    if (x[touse[i] - 1])
      cout << (x[touse[i] - 1] + K - 1) / K << " " << touse[i] << " "
           << touse[0] << '\n';
  }
  for (int i = 1; i < (int)tonotuse.size(); i++) {
    if (x[tonotuse[i] - 1])
      cout << (x[tonotuse[i] - 1] + K - 1) / K << " " << tonotuse[i] << " "
           << tonotuse[0] << '\n';
  }
  if (tousesum > V) {
    if (!tonotuse.empty())
      cout << (tousesum - V) / K << " " << touse[0] << " " << tonotuse[0]
           << '\n';
    else
      cout << (-V + tousesum) / K << " " << touse[0] << " " << touse[1] << '\n';
  }
  if (tousesum < V) {
    if (!touse.empty())
      cout << (V - tousesum) / K << " " << tonotuse[0] << " " << touse[0]
           << '\n';
    else
      cout << (-tousesum + V) / K << " " << tonotuse[0] << " " << tonotuse[1]
           << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
