#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 1;
int n, chk[N];
long long a[N], k, val, dp[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cin >> n >> k >> val;
  long long sum = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (val % k == 0) {
    if (k * (sum / k) < val) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
      for (int i = 1; i < n; i++) {
        long long tmp = (a[i] % k) ? a[i] / k + 1 : a[i] / k;
        if (tmp) cout << tmp << " " << i << " " << n << endl;
        a[n] += a[i];
      }
      if (val / k) cout << val / k << " " << n << " " << 1 << endl;
    }
  } else {
    memset(dp, -1, sizeof dp);
    dp[0] = 0;
    for (int i = 1; i <= n; i++) {
      long long tmp = a[i] % k;
      for (int j = 0; j < k; j++) {
        if (dp[j] != -1 && dp[j] != i && dp[(j + tmp) % k] == -1) {
          dp[(j + tmp) % k] = i;
        }
      }
    }
    long long tmp = val % k;
    if (dp[tmp] == -1) {
      cout << "NO" << endl;
    } else {
      for (; tmp > 0; tmp = (tmp - a[dp[tmp]] % k + k) % k) {
        chk[dp[tmp]] = 1;
      }
      int fnpos = 0, fpos = 0;
      vector<pair<long long, pair<int, int>>> ans;
      for (int i = 1; i <= n; i++) {
        if (!chk[i]) {
          if (fnpos == 0) {
            fnpos = i;
          } else {
            tmp = (a[i] % k) ? a[i] / k + 1 : a[i] / k;
            ans.push_back({tmp, {i, fnpos}});
            a[fnpos] += a[i];
          }
        } else {
          if (fpos == 0) {
            fpos = i;
          } else {
            tmp = (a[i] % k) ? a[i] / k + 1 : a[i] / k;
            ans.push_back({tmp, {i, fpos}});
            a[fpos] += a[i];
          }
        }
      }
      if (a[fpos] + k * (a[fnpos] / k) < val) {
        cout << "NO" << endl;
      } else {
        cout << "YES" << endl;
        if (fnpos == 0) {
          fnpos = (fpos == 1) ? 2 : fpos - 1;
        }
        if (a[fpos] > val) {
          tmp = (a[fpos] - val) / k;
          ans.push_back({tmp, {fpos, fnpos}});
        } else if (a[fpos] < val) {
          tmp = (val - a[fpos]) / k;
          ans.push_back({tmp, {fnpos, fpos}});
        }
        for (int i = 0; i < ans.size(); i++) {
          if (ans[i].first) {
            cout << ans[i].first << " " << ans[i].second.first << " "
                 << ans[i].second.second << endl;
          }
        }
      }
    }
  }
}
