#include <bits/stdc++.h>
using namespace std;
long long n;
int main() {
  scanf("%lld", &n);
  for (long long i = 1, x, y; i <= n; i++) {
    scanf("%lld%lld", &x, &y);
    puts(x - y == 1 ? "NO" : "YES");
  }
  return 0;
}
