#include <bits/stdc++.h>
using namespace std;
//Santa
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t; cin >> t; // number of test cases
while (t--) {
int n; cin >> n;
long long a; cin >> a; // gift allocation can be large
vector<int> score(n);
for (int i = 0; i < n; i++) cin >> score[i];
vector<long long> gifts(n, 1);
// Left to right pass
for (int i = 1; i < n; i++) {
if (score[i] > score[i-1]) {
gifts[i] = gifts[i-1] + 1;
}
}
// Right to left pass
for (int i = n - 2; i >= 0; i--) {
if (score[i] > score[i+1]) {
gifts[i] = max(gifts[i], gifts[i+1] + 1);
}
}
long long total = accumulate(gifts.begin(), gifts.end(), 0LL);
if (total <= a) {
cout << "YES\n";
} else {
cout << "NO\n";
}
}
return 0;
}