#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5000 + 17;
int A[MAXN], B[MAXN], sum;
int dp[MAXN][MAXN];
bool flag[MAXN];
int main() {
  int n, k, v;
  cin >> n >> k >> v;
  int vk = v % k;
  for (int i = 1; i <= n; ++i) {
    cin >> A[i];
    sum += A[i];
    B[i] = A[i];
    A[i] %= k;
  }
  if (sum < v) {
    cout << "NO\n";
    return 0;
  } else {
    dp[0][0] = 1;
    for (int i = 1; i <= n; ++i)
      for (int j = 0; j < k; ++j)
        if (dp[i - 1][j]) {
          dp[i][j] = 1;
          if (!dp[i][(j + A[i]) % k]) dp[i][(j + A[i]) % k] = 2;
        }
    if (!dp[n][vk]) {
      cout << "NO\n";
      return 0;
    } else {
      cout << "YES\n";
      int f1 = -1, f2 = -1;
      for (int i = n; i >= 1; --i) {
        if (dp[i][vk] == 2) {
          flag[i] = true;
          (vk += k - A[i]) %= k;
          if (f1 == -1) f1 = i;
        } else if (f2 == -1)
          f2 = i;
      }
      if (f1 == -1) {
        for (int i = 1; i < n; ++i)
          if (B[i]) cout << (B[i] + k - 1) / k << " " << i << " " << n << "\n";
        if (v / k)
          cout << v / k << " " << n << " "
               << "1\n";
        return 0;
      }
      int S1 = B[f1], S2 = B[f2];
      for (int i = 1; i <= n; ++i) {
        if (i == f1 || i == f2 || !B[i]) continue;
        if (flag[i]) {
          cout << (B[i] + k - 1) / k << " " << i << " " << f1 << "\n";
          S1 += B[i];
        } else {
          cout << (B[i] + k - 1) / k << " " << i << " " << f2 << "\n";
          S2 += B[i];
        }
      }
      int cnt = (v - S1) / k;
      if (cnt > 0)
        cout << cnt << " " << f2 << " " << f1 << "\n";
      else if (cnt < 0)
        cout << -cnt << " " << f1 << " "
             << "1\n";
    }
  }
}
