#include #include using namespace std; string canReachLastPlatform(int N, int S, int B, vector& H) { int stamina = S; int altitude = H[0]; // 初期高度は H[1](配列では H[0]) for (int i = 0; i < N - 1; ++i) { int next_height = H[i + 1]; // 次の足場に行く前に必要ならば高度を上げる if (altitude < next_height) { int needed_stamina = (next_height - altitude + B - 1) / B; // 切り上げ計算 if (stamina >= needed_stamina) { stamina -= needed_stamina; altitude += needed_stamina * B; } else { return "No"; } } // 次の足場に移動可能か確認 if (altitude >= next_height) { // 足場に着地してスタミナを回復 stamina = S; altitude = next_height; } } return "Yes"; } int main() { int N, S, B; cin >> N >> S >> B; vector H(N); for (int i = 0; i < N; ++i) { cin >> H[i]; } cout << canReachLastPlatform(N, S, B, H) << endl; return 0; }