#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
bool anquan(int n, int m, vector<int>& a, vector<int>& b) {
long long e = m;
// 分离任务类型
vector<pair<int, int>> positive, negative;
for (int i = 0; i < n; i++) {
if (b[i] >= a[i]) {
positive.emplace_back(a[i], b[i]);
} else {
negative.emplace_back(a[i], b[i]);
}
}
// 正收益任务:按消耗从小到大
sort(positive.begin(), positive.end());
// 负收益任务:按差值从大到小
sort(negative.begin(), negative.end(), [](const auto& x, const auto& y) {
return (x.second - x.first) > (y.second - y.first);
});
// 处理正收益任务
for (const auto& task : positive) {
// 进入前检查:必须严格大于消耗
if (e <= task.first) return false;
e =e -task.first+task.second;
}
// 处理负收益任务
for (const auto& task : negative) {
// 进入前检查:必须严格大于消耗
if (e <= task.first) return false;
e = e-task.first+task.second;
}
return e > 0;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
for (int i = 0; i < t; i++) {
int n, m;
cin >> n >> m;
vector<int> a(n), b(n);
for (int j = 0; j < n; j++) {
cin >> a[j] >> b[j];
}
cout << (anquan(n, m, a, b) ? "Yes" : "No") << endl;
}
return 0;
}