#include <bits/stdc++.h>
using namespace std;

using ll = long long;

void solve() {
	ll x, y;
	cin >> x >> y;
	if (x - y != 1) {
		cout << "YES" << endl;
	} else cout << "NO" << endl;
}

int main() {
	int t;
	cin >> t;
	while (t--) solve();
}