#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
const int N = 5050;
int a[N];
int used[N];
int dp[N][N][2];
int n;
int k, v;
const int inf = 1e9;
int solve(int id, int j, int f) {
  if (id == n + 1) {
    if (j == (v % k) and f) return 0;
    return -inf;
  }
  int& x = dp[id][j][f];
  if (x != -1) return x;
  x = 0;
  int op1 = solve(id + 1, (j + a[id]) % k, 1) + a[id];
  int op2 = solve(id + 1, j, f);
  if (op1 > op2) {
    return x = op1;
  }
  return x = op2;
}
void roll(int id, int j, int f) {
  if (id == n + 1) return;
  int op1 = solve(id + 1, (j + a[id]) % k, 1) + a[id];
  int op2 = solve(id + 1, j, f);
  if (op1 > op2) {
    used[id] = 1;
    roll(id + 1, (j + a[id]) % k, 1);
    return;
  }
  roll(id + 1, j, f);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  memset(dp, -1, sizeof(dp));
  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"
         << "\n";
    return 0;
  }
  if (v == 0) {
    cout << "YES"
         << "\n";
    cout << "100000 1 2"
         << "\n";
    return 0;
  }
  if (v % k == 0) {
    cout << "YES"
         << "\n";
    for (int i = 2; i <= n; i++) {
      cout << "100000 " << i << " " << 1 << "\n";
      a[1] += a[i];
    }
    cout << (v / k) << " " << 1 << " " << 2 << "\n";
    return 0;
  }
  int V = v;
  int val = solve(1, 0, 0);
  roll(1, 0, 0);
  tot = 0;
  for (int i = 1; i <= n; i++) {
    if (!used[i]) tot += a[i];
  }
  val += (tot / k) * k;
  if (val >= v) {
    cout << "YES"
         << "\n";
    vector<pair<int, int> > res;
    int pivo = 1;
    vector<int> livre;
    tot = 0;
    for (int i = 1; i <= n; i++) {
      if (used[i]) {
        pivo = i;
        tot += a[i];
        res.push_back(pair<int, int>(-1, i));
      } else {
        livre.push_back(i);
      }
    }
    if ((int)livre.size()) {
      for (int i = 1; i < (int)livre.size(); i++) {
        cout << 100000 << " " << livre[i] << " " << livre[0] << "\n";
        a[livre[0]] += a[livre[i]];
      }
    }
    if (tot < v and (int) livre.size()) {
      int put = a[livre[0]] / k;
      if (put) cout << put << " " << livre[0] << " " << pivo << "\n";
      a[pivo] += put * k;
    }
    for (auto it : res) {
      if (it.second == pivo) continue;
      if (it.first < 0) {
        int put = (a[it.second] + k - 1) / k;
        a[pivo] += a[it.second];
        a[it.second] = 0;
        cout << put << " " << it.second << " " << pivo << "\n";
      }
    }
    int dif = a[pivo] - V;
    int put = dif / k;
    if (put) {
      int other = (pivo == 1 ? 2 : 1);
      cout << put << " " << pivo << " " << other << "\n";
      a[pivo] -= k * put;
    }
    assert(a[pivo] == V);
    return 0;
  }
  cout << "NO"
       << "\n";
  return 0;
}
