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