#include <bits/stdc++.h>
using namespace std;
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    long long a, b;
    cin >> a >> b;
    if (a != b + 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
