#include <bits/stdc++.h>
using namespace std;
const long long INF = (1LL << 60) - 1;
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long x, y;
    cin >> x >> y;
    long long diff = (x - y);
    if (diff > 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
