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