#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 5;
int T, n, k, v, goal, rr;
int arr[N], rem[N];
bool take[N];
bool vis[N][N];
vector<pair<int, pair<int, int>>> mv;
int solve(int idx, int sum) {
  if (vis[idx][sum]) return false;
  vis[idx][sum] = true;
  if (idx >= n) {
    if (sum == goal) {
      return true;
    } else
      return false;
  }
  if (solve(idx + 1, sum)) {
    return true;
  } else {
    sum += rem[idx];
    if (sum >= k) {
      sum -= k;
    }
    if (solve(idx + 1, sum)) {
      take[idx] = true;
      return true;
    }
  }
  return false;
}
int main() {
  scanf("%d %d %d", &n, &k, &v);
  goal = v % k;
  for (int i = 0; i < n; ++i) {
    scanf("%d", arr + i);
    rem[i] = arr[i] % k;
  }
  if (solve(0, 0)) {
    goal = 0;
    int mn = 0, ot;
    for (int i = 0; i < n; ++i) {
      if (take[i]) {
        mn = i;
        break;
      }
    }
    mn ? ot = mn - 1 : ot = mn + 1;
    for (int i = 0; i < n; ++i) {
      if (take[i] && i != mn) {
        mv.push_back({ceil((double)arr[i] / k), {i + 1, mn + 1}});
        arr[mn] += arr[i];
        arr[i] = 0;
      } else if (!take[i] && i != ot) {
        mv.push_back({ceil((double)arr[i] / k), {i + 1, ot + 1}});
        arr[ot] += arr[i];
        arr[i] = 0;
      }
    }
    int cnt;
    if (arr[mn] >= v) {
      cnt = (arr[mn] - v) / k;
    } else if (arr[mn] < v) {
      cnt = (v - arr[mn]);
      if (cnt > arr[ot]) {
        printf("NO\n");
        return 0;
      }
      cnt /= k;
      cnt = -cnt;
    }
    printf("YES\n");
    for (int i = 0; i < mv.size(); ++i) {
      if (mv[i].first)
        printf("%d %d %d\n", mv[i].first, mv[i].second.first,
               mv[i].second.second);
    }
    if (cnt > 0) {
      printf("%d %d %d\n", cnt, mn + 1, ot + 1);
    } else if (cnt < 0) {
      printf("%d %d %d\n", -cnt, ot + 1, mn + 1);
    }
  } else
    printf("NO\n");
}
