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