#include <bits/stdc++.h>
using namespace std;
bool comp1(pair<int, int> &a, pair<int, int> &b) { return a.second > b.second; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long a, b;
    cin >> a >> b;
    if ((a - b) % 2 == 0 || (a % 2 != 0 && b % 2 != 0))
      cout << "YES\n";
    else {
      if (a - b == 1)
        cout << "NO\n";
      else
        cout << "YES\n";
    }
  }
}
