#include <bits/stdc++.h>
using namespace std;
inline long long min2(long long a, long long b) {
  return (a) < (b) ? (a) : (b);
}
inline long long max2(long long a, long long b) {
  return (a) > (b) ? (a) : (b);
}
inline long long max3(long long a, long long b, long long c) {
  return (a) > (b) ? ((a) > (c) ? (a) : (c)) : ((b) > (c) ? (b) : (c));
}
inline long long min3(long long a, long long b, long long c) {
  return (a) < (b) ? ((a) < (c) ? (a) : (c)) : ((b) < (c) ? (b) : (c));
}
void process() {
  long long int x, y;
  cin >> x >> y;
  long long int z = x - y;
  if (z % 2 == 0)
    cout << "YES" << endl;
  else if (z % 2 != 0) {
    if (z > 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t;
  cin >> t;
  ;
  while (t--) process();
}
