#include <bits/stdc++.h>
namespace competitive_programming {
inline namespace utility {}
namespace debugging {}
namespace io {}
}  // namespace competitive_programming
namespace competitive_programming::utility {
class timer {
 private:
  std::chrono::time_point<std::chrono::steady_clock> begin, end;

 public:
  timer() : begin(), end() {}
  ~timer() {}
};
}  // namespace competitive_programming::utility
constexpr bool test_cases = true;
void yes() { std::cout << "YES\n"; }
void no() { std::cout << "NO\n"; }
auto solve() -> void {
  int64_t x, y;
  std::cin >> x >> y;
  if (x - y < 2)
    no();
  else
    yes();
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.precision(10);
  std::cerr.precision(10);
  std::cout << std::fixed << std::boolalpha;
  std::cerr << std::fixed << std::boolalpha;
  competitive_programming::timer t;
  int32_t cases = 1;
  if (test_cases) std::cin >> cases;
  while (cases--) solve();
  return 0;
}
