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