#include <bits/stdc++.h>
using namespace std;

template <typename T>
T inverse(T a, T m) {
  T u = 0, v = 1;
  while (a != 0) {
    T t = m / a;
    m -= t * a; swap(a, m);
    u -= t * v; swap(u, v);
  }
  assert(m == 1);
  return u;
}

template <typename T>
class Modular {
 public:
  using Type = typename decay<decltype(T::value)>::type;

  constexpr Modular() : value() {}
  template <typename U>
  Modular(const U& x) {
    value = normalize(x);
  }

  template <typename U>
  static Type normalize(const U& x) {
    Type v;
    if (-mod() <= x && x < mod()) v = static_cast<Type>(x);
    else v = static_cast<Type>(x % mod());
    if (v < 0) v += mod();
    return v;
  }

  const Type& operator()() const { return value; }
  template <typename U>
  explicit operator U() const { return static_cast<U>(value); }
  constexpr static Type mod() { return T::value; }

  Modular& operator+=(const Modular& other) { if ((value += other.value) >= mod()) value -= mod(); return *this; }
  Modular& operator-=(const Modular& other) { if ((value -= other.value) < 0) value += mod(); return *this; }
  template <typename U> Modular& operator+=(const U& other) { return *this += Modular(other); }
  template <typename U> Modular& operator-=(const U& other) { return *this -= Modular(other); }
  Modular& operator++() { return *this += 1; }
  Modular& operator--() { return *this -= 1; }
  Modular operator++(int) { Modular result(*this); *this += 1; return result; }
  Modular operator--(int) { Modular result(*this); *this -= 1; return result; }
  Modular operator-() const { return Modular(-value); }

  template <typename U = T>
  typename enable_if<is_same<typename Modular<U>::Type, int>::value, Modular>::type& operator*=(const Modular& rhs) {
#ifdef _WIN32
    uint64_t x = static_cast<int64_t>(value) * static_cast<int64_t>(rhs.value);
    uint32_t xh = static_cast<uint32_t>(x >> 32), xl = static_cast<uint32_t>(x), d, m;
    asm(
      "divl %4; \n\t"
      : "=a" (d), "=d" (m)
      : "d" (xh), "a" (xl), "r" (mod())
    );
    value = m;
#else
    value = normalize(static_cast<int64_t>(value) * static_cast<int64_t>(rhs.value));
#endif
    return *this;
  }
  template <typename U = T>
  typename enable_if<is_same<typename Modular<U>::Type, int64_t>::value, Modular>::type& operator*=(const Modular& rhs) {
    int64_t q = static_cast<int64_t>(static_cast<long double>(value) * rhs.value / mod());
    value = normalize(value * rhs.value - q * mod());
    return *this;
  }
  template <typename U = T>
  typename enable_if<!is_integral<typename Modular<U>::Type>::value, Modular>::type& operator*=(const Modular& rhs) {
    value = normalize(value * rhs.value);
    return *this;
  }

  Modular& operator/=(const Modular& other) { return *this *= Modular(inverse(other.value, mod())); }

  template <typename U>
  friend const Modular<U>& abs(const Modular<U>& v) { return v; }

  template <typename U>
  friend bool operator==(const Modular<U>& lhs, const Modular<U>& rhs);

  template <typename U>
  friend bool operator<(const Modular<U>& lhs, const Modular<U>& rhs);

  template <typename U>
  friend std::istream& operator>>(std::istream& stream, Modular<U>& number);

 private:
  Type value;
};

template <typename T> bool operator==(const Modular<T>& lhs, const Modular<T>& rhs) { return lhs.value == rhs.value; }
template <typename T, typename U> bool operator==(const Modular<T>& lhs, U rhs) { return lhs == Modular<T>(rhs); }
template <typename T, typename U> bool operator==(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) == rhs; }

template <typename T> bool operator!=(const Modular<T>& lhs, const Modular<T>& rhs) { return !(lhs == rhs); }
template <typename T, typename U> bool operator!=(const Modular<T>& lhs, U rhs) { return !(lhs == rhs); }
template <typename T, typename U> bool operator!=(U lhs, const Modular<T>& rhs) { return !(lhs == rhs); }

template <typename T> bool operator<(const Modular<T>& lhs, const Modular<T>& rhs) { return lhs.value < rhs.value; }

template <typename T> Modular<T> operator+(const Modular<T>& lhs, const Modular<T>& rhs) { return Modular<T>(lhs) += rhs; }
template <typename T, typename U> Modular<T> operator+(const Modular<T>& lhs, U rhs) { return Modular<T>(lhs) += rhs; }
template <typename T, typename U> Modular<T> operator+(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) += rhs; }

template <typename T> Modular<T> operator-(const Modular<T>& lhs, const Modular<T>& rhs) { return Modular<T>(lhs) -= rhs; }
template <typename T, typename U> Modular<T> operator-(const Modular<T>& lhs, U rhs) { return Modular<T>(lhs) -= rhs; }
template <typename T, typename U> Modular<T> operator-(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) -= rhs; }

template <typename T> Modular<T> operator*(const Modular<T>& lhs, const Modular<T>& rhs) { return Modular<T>(lhs) *= rhs; }
template <typename T, typename U> Modular<T> operator*(const Modular<T>& lhs, U rhs) { return Modular<T>(lhs) *= rhs; }
template <typename T, typename U> Modular<T> operator*(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) *= rhs; }

template <typename T> Modular<T> operator/(const Modular<T>& lhs, const Modular<T>& rhs) { return Modular<T>(lhs) /= rhs; }
template <typename T, typename U> Modular<T> operator/(const Modular<T>& lhs, U rhs) { return Modular<T>(lhs) /= rhs; }
template <typename T, typename U> Modular<T> operator/(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) /= rhs; }

template<typename T, typename U>
Modular<T> power(const Modular<T>& a, const U& b) {
  assert(b >= 0);
  Modular<T> x = a, res = 1;
  U p = b;
  while (p > 0) {
    if (p & 1) res *= x;
    x *= x;
    p >>= 1;
  }
  return res;
}

template <typename T>
bool IsZero(const Modular<T>& number) {
  return number() == 0;
}

template <typename T>
string to_string(const Modular<T>& number) {
  return to_string(number());
}

template <typename T>
std::ostream& operator<<(std::ostream& stream, const Modular<T>& number) {
  return stream << number();
}

template <typename T>
std::istream& operator>>(std::istream& stream, Modular<T>& number) {
  typename common_type<typename Modular<T>::Type, int64_t>::type x;
  stream >> x;
  number.value = Modular<T>::normalize(x);
  return stream;
}

/*
using ModType = int;

struct VarMod { static ModType value; };
ModType VarMod::value;
ModType& md = VarMod::value;
using Mint = Modular<VarMod>;
*/

constexpr int md = 998244353;
using Mint = Modular<std::integral_constant<decay<decltype(md)>::type, md>>;
int main () {

  ios_base::sync_with_stdio(false);
  cin.tie(nullptr); cout.tie(nullptr);

  int T; cin >> T;
  while (T--) {
    int64_t l, r; cin >> l >> r;
    cout << (l == 1 || r <= 2 ? "NO\n": "YES\n");
  }

  return 0;
}


#include <bits/stdc++.h>
using namespace std;

template <typename T>
T inverse(T a, T m) {
  T u = 0, v = 1;
  while (a != 0) {
    T t = m / a;
    m -= t * a; swap(a, m);
    u -= t * v; swap(u, v);
  }
  assert(m == 1);
  return u;
}

template <typename T>
class Modular {
 public:
  using Type = typename decay<decltype(T::value)>::type;

  constexpr Modular() : value() {}
  template <typename U>
  Modular(const U& x) {
    value = normalize(x);
  }

  template <typename U>
  static Type normalize(const U& x) {
    Type v;
    if (-mod() <= x && x < mod()) v = static_cast<Type>(x);
    else v = static_cast<Type>(x % mod());
    if (v < 0) v += mod();
    return v;
  }

  const Type& operator()() const { return value; }
  template <typename U>
  explicit operator U() const { return static_cast<U>(value); }
  constexpr static Type mod() { return T::value; }

  Modular& operator+=(const Modular& other) { if ((value += other.value) >= mod()) value -= mod(); return *this; }
  Modular& operator-=(const Modular& other) { if ((value -= other.value) < 0) value += mod(); return *this; }
  template <typename U> Modular& operator+=(const U& other) { return *this += Modular(other); }
  template <typename U> Modular& operator-=(const U& other) { return *this -= Modular(other); }
  Modular& operator++() { return *this += 1; }
  Modular& operator--() { return *this -= 1; }
  Modular operator++(int) { Modular result(*this); *this += 1; return result; }
  Modular operator--(int) { Modular result(*this); *this -= 1; return result; }
  Modular operator-() const { return Modular(-value); }

  template <typename U = T>
  typename enable_if<is_same<typename Modular<U>::Type, int>::value, Modular>::type& operator*=(const Modular& rhs) {
#ifdef _WIN32
    uint64_t x = static_cast<int64_t>(value) * static_cast<int64_t>(rhs.value);
    uint32_t xh = static_cast<uint32_t>(x >> 32), xl = static_cast<uint32_t>(x), d, m;
    asm(
      "divl %4; \n\t"
      : "=a" (d), "=d" (m)
      : "d" (xh), "a" (xl), "r" (mod())
    );
    value = m;
#else
    value = normalize(static_cast<int64_t>(value) * static_cast<int64_t>(rhs.value));
#endif
    return *this;
  }
  template <typename U = T>
  typename enable_if<is_same<typename Modular<U>::Type, int64_t>::value, Modular>::type& operator*=(const Modular& rhs) {
    int64_t q = static_cast<int64_t>(static_cast<long double>(value) * rhs.value / mod());
    value = normalize(value * rhs.value - q * mod());
    return *this;
  }
  template <typename U = T>
  typename enable_if<!is_integral<typename Modular<U>::Type>::value, Modular>::type& operator*=(const Modular& rhs) {
    value = normalize(value * rhs.value);
    return *this;
  }

  Modular& operator/=(const Modular& other) { return *this *= Modular(inverse(other.value, mod())); }

  template <typename U>
  friend const Modular<U>& abs(const Modular<U>& v) { return v; }

  template <typename U>
  friend bool operator==(const Modular<U>& lhs, const Modular<U>& rhs);

  template <typename U>
  friend bool operator<(const Modular<U>& lhs, const Modular<U>& rhs);

  template <typename U>
  friend std::istream& operator>>(std::istream& stream, Modular<U>& number);

 private:
  Type value;
};

template <typename T> bool operator==(const Modular<T>& lhs, const Modular<T>& rhs) { return lhs.value == rhs.value; }
template <typename T, typename U> bool operator==(const Modular<T>& lhs, U rhs) { return lhs == Modular<T>(rhs); }
template <typename T, typename U> bool operator==(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) == rhs; }

template <typename T> bool operator!=(const Modular<T>& lhs, const Modular<T>& rhs) { return !(lhs == rhs); }
template <typename T, typename U> bool operator!=(const Modular<T>& lhs, U rhs) { return !(lhs == rhs); }
template <typename T, typename U> bool operator!=(U lhs, const Modular<T>& rhs) { return !(lhs == rhs); }

template <typename T> bool operator<(const Modular<T>& lhs, const Modular<T>& rhs) { return lhs.value < rhs.value; }

template <typename T> Modular<T> operator+(const Modular<T>& lhs, const Modular<T>& rhs) { return Modular<T>(lhs) += rhs; }
template <typename T, typename U> Modular<T> operator+(const Modular<T>& lhs, U rhs) { return Modular<T>(lhs) += rhs; }
template <typename T, typename U> Modular<T> operator+(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) += rhs; }

template <typename T> Modular<T> operator-(const Modular<T>& lhs, const Modular<T>& rhs) { return Modular<T>(lhs) -= rhs; }
template <typename T, typename U> Modular<T> operator-(const Modular<T>& lhs, U rhs) { return Modular<T>(lhs) -= rhs; }
template <typename T, typename U> Modular<T> operator-(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) -= rhs; }

template <typename T> Modular<T> operator*(const Modular<T>& lhs, const Modular<T>& rhs) { return Modular<T>(lhs) *= rhs; }
template <typename T, typename U> Modular<T> operator*(const Modular<T>& lhs, U rhs) { return Modular<T>(lhs) *= rhs; }
template <typename T, typename U> Modular<T> operator*(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) *= rhs; }

template <typename T> Modular<T> operator/(const Modular<T>& lhs, const Modular<T>& rhs) { return Modular<T>(lhs) /= rhs; }
template <typename T, typename U> Modular<T> operator/(const Modular<T>& lhs, U rhs) { return Modular<T>(lhs) /= rhs; }
template <typename T, typename U> Modular<T> operator/(U lhs, const Modular<T>& rhs) { return Modular<T>(lhs) /= rhs; }

template<typename T, typename U>
Modular<T> power(const Modular<T>& a, const U& b) {
  assert(b >= 0);
  Modular<T> x = a, res = 1;
  U p = b;
  while (p > 0) {
    if (p & 1) res *= x;
    x *= x;
    p >>= 1;
  }
  return res;
}

template <typename T>
bool IsZero(const Modular<T>& number) {
  return number() == 0;
}

template <typename T>
string to_string(const Modular<T>& number) {
  return to_string(number());
}

template <typename T>
std::ostream& operator<<(std::ostream& stream, const Modular<T>& number) {
  return stream << number();
}

template <typename T>
std::istream& operator>>(std::istream& stream, Modular<T>& number) {
  typename common_type<typename Modular<T>::Type, int64_t>::type x;
  stream >> x;
  number.value = Modular<T>::normalize(x);
  return stream;
}

/*
using ModType = int;

struct VarMod { static ModType value; };
ModType VarMod::value;
ModType& md = VarMod::value;
using Mint = Modular<VarMod>;
*/

constexpr int md = 998244353;
using Mint = Modular<std::integral_constant<decay<decltype(md)>::type, md>>;
int main () {

  ios_base::sync_with_stdio(false);
  cin.tie(nullptr); cout.tie(nullptr);

  int T; cin >> T;
  while (T--) {
    int64_t l, r; cin >> l >> r;
    cout << (l == 1 || r == 2) ? "NO\n": "YES\n");
  }

  return 0;
}


import java.util.Scanner;

public class Solve {
    public static void main(final String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        while (T > 0) {
            int L = in.nextInt();
            int R = in.nextInt();
            if (2*L <= R) {
                System.out.println("NO");
            }else {
                System.out.println("YES");
            }
        --T;
        }
        in.close();
    }
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        int l,r;
        cin>>l>>r;
        int flag=0;
        for(int a=1;a<=l*r;a++){
            int la=l/a;
            int ra=r/a;
            double l=la/(ra*1.0);
            double r=l/(r*1.0);
            if(r>=l){
                flag=1;
                break;
            }
        }
        if(flag){
            cout<<"YES\n";
        }else{
            cout<<"NO\n";
        }
    }
    return 0
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        long long l,r;
        cin>>l>>r;
        int flag;
        for(long long a=1;a<l*r;a++){
            flag=1;
            for(long long i=l;i<=r;i++){
                if(i%a < i/a){
                    flag=0;
                    break;
                }
            }
            if(flag) break;
        }
        if(flag){
            cout<<"YES\n";
        }else{
            cout<<"NO\n";
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        cin>>l>>r;
        if(r<2*l)
            cout<<"YES\n";
        else
            cout<<"NO\n";
    }
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        int l,r;
        cin>>l>>r;
        int flag;
        for(int a=1;a<l*r;a++){
            flag=1;
            for(int i=l;i<=l;i++){
                if(i%a < i/a){
                    flag=0;
                    break;
                }
            }
            if(flag) break;
        }
        if(flag){
            cout<<"YES\n";
        }else{
            cout<<"NO\n";
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        int l,r;
        cin>>l>>r;
        if(r<2*l)
            cout<<"YES\n";
        else
            cout<<"NO\n";
    }
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        int l,r;
        cin>>l>>r;
        int flag=0;
        for(int a=1;a<=l*r;a++){
            int la=l/a;
            int ra=r/a;
            double l=la/(ra*1.0);
            double r=l/(r*1.0);
            if(r>=l){
                flag=1;
                break;
            }
        }
        if(flag){
            cout<<"YES\n";
        }else{
            cout<<"NO\n";
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        long long l,r;
        cin>>l>>r;
        int flag;
        for(long long a=1;a<l*r;a++){
            flag=1;
            for(long long i=l;i<=l;i++){
                if(i%a < i/a){
                    flag=0;
                    break;
                }
            }
            if(flag) break;
        }
        if(flag){
            cout<<"YES\n";
        }else{
            cout<<"NO\n";
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        int l,r;
        cin>>l>>r;
        int flag=0;
        for(int a=1;a<=1000000000;a++){
            int la=l/a;
            int ra=r/a;
            double l=la/(ra*1.0);
            double r=l/(r*1.0);
            if(r>=l){
                flag=1;
                break;
            }
        }
        if(flag){
            cout<<"YES\n";
        }else{
            cout<<"NO\n";
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        int l,r;
        cin>>l>>r;
        int flag=0;
        for(int a=1;a<=1000000000;a++){
            int la=l/a;
            int ra=r/a;
            double l=la/(ra*1.0);
            double r=l/(r*1.0);
            if(r>=l){
                flag=1;
                break;
            }
        }
        if(flag){
            cout<<"YES\n";
        }else{
            cout<<"NO\n";
        }
    }
    return 0
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        int l,r;
        cin>>l>>r;
        if(r>2*l)
            cout<<"YES\n";
        else
            cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	int t, yes;
	long long a, b, pack, can, tempa, tempb;
	cin >> t;
	for (int i = 0; i < t; i++){
		cin >> a >> b;
		yes = 0;
		for (pack = 2; pack < a*2; pack++){
			tempa = a - a / pack;
			tempb = b - b / pack;
			double packdiv = pack/2;
			if ((tempa % pack >= packdiv) && (tempb % pack >= packdiv)){
				yes = 1;
				cout << "YES\n";
				break;
			}
		}
		if (yes == 0){
		cout << "NO\n";}

	}
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	int t, yes;
	long long a, b, pack, can;
	cin >> t;
	for (int i = 0; i < t; i++){
		cin >> a >> b;
		yes = 0;
		for (can = a; can <= b; can++){
			for (pack = a; pack < a*2; pack++){
				if (can % pack > pack/2){
					cout << "YES\n";
					yes = 1;
					break;
				}
			}
			if(yes){
				break;
			}
		}
		if (yes == 0){
		cout << "NO\n";}

	}
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int t;
  cin >> t;
  for (int tt = 0; tt < t; tt++)
  {
    int l,r;
    cin>>l>>r;

    if(l*2>r)
    {
      cout<<"YES\n";
    }
    else
    {
      cout << "NO\n";
    }

  }
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	int t, yes;
	long long a, b, pack, can, tempa, tempb;
	cin >> t;
	for (int i = 0; i < t; i++){
		cin >> a >> b;
		yes = 0;
		for (pack = 2; pack <= a*2-1; pack++){
			tempa = a - a / pack;
			tempb = b - b / pack;
			if ((tempa % pack >= pack/2) && (tempb % pack >= pack/2)){
				yes = 1;
				cout << "YES\n";
				break;
			}
		}
		if (yes == 0){
		cout << "NO\n";}

	}
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	int t, yes;
	long long a, b, pack, can;
	cin >> t;
	for (int i = 0; i < t; i++){
		cin >> a >> b;
		yes = 0;
		for (pack = b+2; pack < b*2; pack++){
			for (can = a; can <= b; can++){
				if (can % pack >= pack/2){
					yes = 1;
				}
				else{
					yes = 0;
					break;
				}
			}
			if(yes){
				cout << "YES\n";
				break;
			}
		}
		if (yes == 0){
		cout << "NO\n";}

	}
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	int t, yes;
	long long a, b, pack, can;
	cin >> t;
	for (int i = 0; i < t; i++){
		cin >> a >> b;
		yes = 0;
		for (can = a; can < b; can++){
			for (pack = a; pack < a*2-1; pack++){
				if (can % pack >= pack/2){
					cout << "YES\n";
					yes = 1;
					break;
				}
				if(yes){
					break;
				}
			}
			if(yes){
				break;
			}
		}
		if (yes == 0){
		cout << "NO\n";}

	}
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	int t, yes;
	long long l, r;
	long long two = 2;
	cin >> t;
	for (int i = 0 ; i < t; i++){
		cin >> l >> r;
		yes = 0;
		for (long long a = max(two, l/2); a <= l*2; a++){
			for (long long x = l; x <= r; x++){
				if (x % a >= a/2){
					yes = 1;
				}
				else{
					yes = 0;
					break;
				}
			}
			if (yes){
				cout << "YES\n";
				break;
			}
		}
		if(!yes){
			cout << "NO\n";
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	int t, yes;
	long long a, b, pack, can;
	cin >> t;
	for (int i = 0; i < t; i++){
		cin >> a >> b;
		yes = 0;
		for (can = a; can <= b; can++){
			for (pack = a; pack < a*2-1; pack++){
				if (can % pack >= pack/2){
					cout << "YES\n";
					yes = 1;
					break;
				}
			}
			if(yes){
				break;
			}
		}
		if (yes == 0){
		cout << "NO\n";}

	}
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	int t, yes;
	long long l, r;
	cin >> t;
	for (int i = 0 ; i < t; i++){
		cin >> l >> r;
		yes = 0;
		for (long long a = 2; a <= l*2; a++){
			if ((l % a >= l/2) && (r % a >= r/2)){
				yes = 1;
				cout << "YES\n";
				break;
			}
		}
		if(!yes){
			cout << "NO\n";
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	int t, yes;
	long long l, r;
	long long two = 2;
	cin >> t;
	for (int i = 0 ; i < t; i++){
		cin >> l >> r;
		yes = 0;
		for (long long a = max(two, l/2); a <= l*2; a++){
			long long templ = l % a;
			long long tempr = r % a;
			for (long long x = templ; x <= tempr; x++){
				if (x >= a/2){
					yes = 1;
				}
				else{
					yes = 0;
					break;
				}
			}
			if (yes){
				cout << "YES\n";
				break;
			}
		}
		if(!yes){
			cout << "NO\n";
		}
	}
}


#include <bits/stdc++.h.
using namespace std;
int main(){
    int t;
  cin >> t;
  for (int tt = 0; tt < t; tt++)
  {
    int l,r;
    cin>>l>>r;

    if(l*2>r)
    {
      cout<<"YES\n";
    }
    else
    {
      cout << "NO\n";
    }

  }
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	int t, yes;
	long long a, b, pack, can;
	cin >> t;
	for (int i = 0; i < t; i++){
		cin >> a >> b;
		yes = 0;
		for (pack = a; pack < a*2-1; pack++){
			for (can = a; can <= b; can++){
				if (can % pack >= pack/2){
					yes = 1;
				}
				else{
					yes = 0;
				}
			}
			if(yes){
				cout << "YES\n";
				break;
			}
		}
		if (yes == 0){
		cout << "NO\n";}

	}
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	int t, yes;
	long long a, b, pack, can;
	cin >> t;
	for (int i = 0; i < t; i++){
		cin >> a >> b;
		yes = 0;
		for (pack = a+1; pack < a*2; pack++){
			for (can = a; can <= b; can++){
				if (can % pack >= pack/2){
					yes = 1;
				}
				else{
					yes = 0;
					break;
				}
			}
			if(yes){
				cout << "YES\n";
				break;
			}
		}
		if (yes == 0){
		cout << "NO\n";}

	}
}


#include <bits/stdc++.h>
using namespace std;

int main (){
	int t, yes;
	long long l, r;
	cin >> t;
	for (int i = 0 ; i < t; i++){
		cin >> l >> r;
		yes = 0;
		for (long long a = 2; a <= l*2; a++){
			for (long long x = l; x <= r; x++){
				if (x % a >= a/2){
					yes = 1;
				}
				else{
					yes = 0;
					break;
				}
			}
			if (yes){
				cout << "YES\n";
				break;
			}
		}
		if(!yes){
			cout << "NO\n";
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define p push
#define pp pop

#define B begin()
#define E end()
#define rB rbegin()
#define rE rend()
#define Si size()
#define C count()
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

typedef long long int ll;
#define V(type) vector<type>
#define PQ(type) priority_queue<type>
#define pll pair<ll, ll>
#define F first
#define S second
#define rep(i,n) for(int i=0;i<n;i++)

#define rep1(i,n) for(int i=1;i<=n;i++)
#define rrep(i,n) for(int i=n;i>0;i--)

#define mod 1000000007
#define INF 9223372036854775807
const double delta = 0.0000000001;
const double pi = 3.1415926535;

void FAST() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
ll fact(ll n)
{
    if(n<2)return 1;
    else return n*fact(n-1);
}

ll powM(ll x, ll y, ll m) {  //returns (a^b)%m ( ^ is exponent )
  ll ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y)
  {
    if (r & y)
    {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
ll gcd(ll x, ll y) {
    if (x == 0) return y;
    return gcd((ll)y % x, (ll)x);
}
ll countBits(ll n) {
    ll count = 0;
    while (n) {
        count++;
        n >>= 1;
    }
    return count;
}

ll isP(ll n) {
    if (n == 0 || n == 1) return 0;
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) return 0;
    }
    return 1;
}

int main()
{
ll t;
cin>>t;
while(t--)
{
    int l,r;
    cin>>l>>r;
    if(l==r)cout<<"YES\n";
    else if(l==1 || 2*l<=r)cout<<"NO\n";

    else  cout<<"YES\n";

}

return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define p push
#define pp pop

#define B begin()
#define E end()
#define rB rbegin()
#define rE rend()
#define Si size()
#define C count()
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

typedef long long int ll;
#define V(type) vector<type>
#define PQ(type) priority_queue<type>
#define pll pair<ll, ll>
#define F first
#define S second
#define rep(i,n) for(ll i=0;i<n;i++)

#define rep1(i,n) for(int i=1;i<=n;i++)
#define rrep(i,n) for(int i=n;i>0;i--)

#define mod 1000000007
#define INF 9223372036854775807
const double delta = 0.0000000001;
const double pi = 3.1415926535;

void FAST() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
ll fact(ll n)
{
    if(n<2)return 1;
    else return n*fact(n-1);
}

ll powM(ll x, ll y, ll m) {  //returns (a^b)%m ( ^ is exponent )
  ll ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y)
  {
    if (r & y)
    {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
ll gcd(ll x, ll y) {
    if (x == 0) return y;
    return gcd((ll)y % x, (ll)x);
}
ll countBits(ll n) {
    ll count = 0;
    while (n) {
        count++;
        n >>= 1;
    }
    return count;
}

ll isP(ll n) {
    if (n == 0 || n == 1) return 0;
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) return 0;
    }
    return 1;
}

int main()
{ll t;
cin>>t;
while(t--)
{
  int l,r;
  cin>>l>>r;
  if(l==1 || 2*l<r)cout<<"NO\n";
  else cout<<"YES\n";
}

return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define p push
#define pp pop

#define B begin()
#define E end()
#define rB rbegin()
#define rE rend()
#define Si size()
#define C count()
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

typedef long long int ll;
#define V(type) vector<type>
#define PQ(type) priority_queue<type>
#define pll pair<ll, ll>
#define F first
#define S second
#define rep(i,n) for(int i=0;i<n;i++)

#define rep1(i,n) for(int i=1;i<=n;i++)
#define rrep(i,n) for(int i=n;i>0;i--)

#define mod 1000000007
#define INF 9223372036854775807
const double delta = 0.0000000001;
const double pi = 3.1415926535;

void FAST() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
ll fact(ll n)
{
    if(n<2)return 1;
    else return n*fact(n-1);
}

ll powM(ll x, ll y, ll m) {  //returns (a^b)%m ( ^ is exponent )
  ll ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y)
  {
    if (r & y)
    {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
ll gcd(ll x, ll y) {
    if (x == 0) return y;
    return gcd((ll)y % x, (ll)x);
}
ll countBits(ll n) {
    ll count = 0;
    while (n) {
        count++;
        n >>= 1;
    }
    return count;
}

ll isP(ll n) {
    if (n == 0 || n == 1) return 0;
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) return 0;
    }
    return 1;
}

int main()
{
int t;
cin>>t;
while(t--)
{
  int l,r;
  cin>>l>>r;int c;
  if(l==1)cout<<"NO\n";
  else{
  for(int a=1;a<r;a++)
  {c=1;
    for(int i=l;i<=r;i++)
    {
      if(i%a < a/2){c=0;break;}
    }
  if(c==1)break;
  }
  for(int a=r+1;a<2*r+1;a++)
  {c=1;
    for(int i=l;i<=r;i++)
    {
      if(i%a < a/2){c=0;break;}
    }
  if(c==1)break;
  }
  if(c)cout<<"YES\n";else cout<<"NO\n";
}
}
return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define p push
#define pp pop

#define B begin()
#define E end()
#define rB rbegin()
#define rE rend()
#define Si size()
#define C count()
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

typedef long long int ll;
#define V(type) vector<type>
#define PQ(type) priority_queue<type>
#define pll pair<ll, ll>
#define F first
#define S second
#define rep(i,n) for(int i=0;i<n;i++)

#define rep1(i,n) for(int i=1;i<=n;i++)
#define rrep(i,n) for(int i=n;i>0;i--)

#define mod 1000000007
#define INF 9223372036854775807
const double delta = 0.0000000001;
const double pi = 3.1415926535;

void FAST() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
ll fact(ll n)
{
    if(n<2)return 1;
    else return n*fact(n-1);
}

ll powM(ll x, ll y, ll m) {  //returns (a^b)%m ( ^ is exponent )
  ll ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y)
  {
    if (r & y)
    {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
ll gcd(ll x, ll y) {
    if (x == 0) return y;
    return gcd((ll)y % x, (ll)x);
}
ll countBits(ll n) {
    ll count = 0;
    while (n) {
        count++;
        n >>= 1;
    }
    return count;
}

ll isP(ll n) {
    if (n == 0 || n == 1) return 0;
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) return 0;
    }
    return 1;
}

int main()
{
int t;
cin>>t;
while(t--)
{
  int l,r;
  cin>>l>>r;int c;
  if(l==1)cout<<"NO\n";
  else{
  for(int a=1;a<l;a++)
  {c=1;
    for(int i=l;i<=r;i++)
    {
      if(i%a < a/2){c=0;break;}
    }
  if(c==1)break;
  }
  for(int a=r+1;a<2*r+1;a++)
  {c=1;
    for(int i=l;i<=r;i++)
    {
      if(i%a < a/2){c=0;break;}
    }
  if(c==1)break;
  }
  if(c)cout<<"YES\n";else cout<<"NO\n";
}
}
return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define p push
#define pp pop

#define B begin()
#define E end()
#define rB rbegin()
#define rE rend()
#define Si size()
#define C count()
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

typedef long long int ll;
#define V(type) vector<type>
#define PQ(type) priority_queue<type>
#define pll pair<ll, ll>
#define F first
#define S second
#define rep(i,n) for(ll i=0;i<n;i++)

#define rep1(i,n) for(int i=1;i<=n;i++)
#define rrep(i,n) for(int i=n;i>0;i--)

#define mod 1000000007
#define INF 9223372036854775807
const double delta = 0.0000000001;
const double pi = 3.1415926535;

void FAST() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
ll fact(ll n)
{
    if(n<2)return 1;
    else return n*fact(n-1);
}

ll powM(ll x, ll y, ll m) {  //returns (a^b)%m ( ^ is exponent )
  ll ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y)
  {
    if (r & y)
    {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
ll gcd(ll x, ll y) {
    if (x == 0) return y;
    return gcd((ll)y % x, (ll)x);
}
ll countBits(ll n) {
    ll count = 0;
    while (n) {
        count++;
        n >>= 1;
    }
    return count;
}

ll isP(ll n) {
    if (n == 0 || n == 1) return 0;
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) return 0;
    }
    return 1;
}

int main()
{ll t;
cin>>t;
while(t--)
{
  int l,r;
  cin>>l>>r;
  if((l==1  && r!=1)|| (2*l<r))cout<<"NO\n";
  else cout<<"YES\n";
}

return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define p push
#define pp pop

#define B begin()
#define E end()
#define rB rbegin()
#define rE rend()
#define Si size()
#define C count()
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

typedef long long int ll;
#define V(type) vector<type>
#define PQ(type) priority_queue<type>
#define pll pair<ll, ll>
#define F first
#define S second
#define rep(i,n) for(int i=0;i<n;i++)

#define rep1(i,n) for(int i=1;i<=n;i++)
#define rrep(i,n) for(int i=n;i>0;i--)

#define mod 1000000007
#define INF 9223372036854775807
const double delta = 0.0000000001;
const double pi = 3.1415926535;

void FAST() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
ll fact(ll n)
{
    if(n<2)return 1;
    else return n*fact(n-1);
}

ll powM(ll x, ll y, ll m) {  //returns (a^b)%m ( ^ is exponent )
  ll ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y)
  {
    if (r & y)
    {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
ll gcd(ll x, ll y) {
    if (x == 0) return y;
    return gcd((ll)y % x, (ll)x);
}
ll countBits(ll n) {
    ll count = 0;
    while (n) {
        count++;
        n >>= 1;
    }
    return count;
}

ll isP(ll n) {
    if (n == 0 || n == 1) return 0;
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) return 0;
    }
    return 1;
}

int main()
{
  ll t;cin>>t;while(t--)
  {
    ll l,r;
    cin>>l>>r;
    int c=1;
    for(int a=2;a<r;a++)
    {
    for(ll i=l;i<=r;i++)
    {
      if((i/a)%a<((a/2))){c=0;break;}
    }
    if(c==1)break;}
  if(c==0)cout<<"YES\n";else cout<<"NO\n";
  }

return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define p push
#define pp pop

#define B begin()
#define E end()
#define rB rbegin()
#define rE rend()
#define Si size()
#define C count()
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

typedef long long int ll;
#define V(type) vector<type>
#define PQ(type) priority_queue<type>
#define pll pair<ll, ll>
#define F first
#define S second
#define rep(i,n) for(ll i=0;i<n;i++)

#define rep1(i,n) for(int i=1;i<=n;i++)
#define rrep(i,n) for(int i=n;i>0;i--)

#define mod 1000000007
#define INF 9223372036854775807
const double delta = 0.0000000001;
const double pi = 3.1415926535;

void FAST() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
ll fact(ll n)
{
    if(n<2)return 1;
    else return n*fact(n-1);
}

ll powM(ll x, ll y, ll m) {  //returns (a^b)%m ( ^ is exponent )
  ll ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y)
  {
    if (r & y)
    {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
ll gcd(ll x, ll y) {
    if (x == 0) return y;
    return gcd((ll)y % x, (ll)x);
}
ll countBits(ll n) {
    ll count = 0;
    while (n) {
        count++;
        n >>= 1;
    }
    return count;
}

ll isP(ll n) {
    if (n == 0 || n == 1) return 0;
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) return 0;
    }
    return 1;
}

int main()
{ll t;
cin>>t;
while(t--)
{
  int l,r;
  cin>>l>>r;
  if((l==1  && r!=1)|| 2*l<r)cout<<"NO\n";
  else cout<<"YES\n";
}

return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define p push
#define pp pop

#define B begin()
#define E end()
#define rB rbegin()
#define rE rend()
#define Si size()
#define C count()
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

typedef long long int ll;
#define V(type) vector<type>
#define PQ(type) priority_queue<type>
#define pll pair<ll, ll>
#define F first
#define S second
#define rep(i,n) for(ll i=0;i<n;i++)

#define rep1(i,n) for(int i=1;i<=n;i++)
#define rrep(i,n) for(int i=n;i>0;i--)

#define mod 1000000007
#define INF 9223372036854775807
const double delta = 0.0000000001;
const double pi = 3.1415926535;

void FAST() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
ll fact(ll n)
{
    if(n<2)return 1;
    else return n*fact(n-1);
}

ll powM(ll x, ll y, ll m) {  //returns (a^b)%m ( ^ is exponent )
  ll ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y)
  {
    if (r & y)
    {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
ll gcd(ll x, ll y) {
    if (x == 0) return y;
    return gcd((ll)y % x, (ll)x);
}
ll countBits(ll n) {
    ll count = 0;
    while (n) {
        count++;
        n >>= 1;
    }
    return count;
}

ll isP(ll n) {
    if (n == 0 || n == 1) return 0;
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) return 0;
    }
    return 1;
}

int main()
{ll t;
cin>>t;
while(t--)
{
  int l,r;
  cin>>l>>r;
  if(l==1)cout<<"NO\n";
  else cout<<"YES\n";
}

return 0;
}


#pragma comment(linker, "/STACK:10000000000")
#define forn(from, to, i) for (int i = from; i < to; ++i)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2")
//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <time.h>
#include <deque>
#include <functional>
using namespace std;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define int long long
#define m_p make_pair
#define all(x) x.begin(), x.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define vi vector<int>
#define si set<int>
#define mii map<int, int>
#define vvi vector<vi>
#define sz(x) (int)((x).size())
#define vpii vector<pii>
template<typename T> ostream& operator<<(ostream & o, vector<T> x) { for (auto it : x) o << it << ' '; return o; }
template<typename T> istream& operator>>(istream & i, vector<T> & x) { for (auto& it : x) i >> it; return i; }
template <typename T> void chkmin(T & a, T &b){ a > b ? a = b : 0; }
template <typename T> void chkmax(T &a, T &b) { a < b ? a = b : 0; }
const int INF = 1000000007;
const int INF2 = 100000000000000007;
const int miniINF = 1e15;
const int MOD = 1172113087;
const int MOD1 = 1000000007;
const int SIZE = 200010;
const int base = 53;
const ldb eps = 1e-6;
const db pi = acos(-1.0);
int q, n, ar[SIZE], a,b,c,d,v,v1,k,m;
string s, t;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    double cl = clock();
#endif
    cin >> q;
    while (q--) {
        cin >> a >> b;
        if (a >= b / 2 + 1) YES;
        else NO;
    }
    //#ifdef _DEBUG
        //cout << "\n\n" << (clock() - cl) / CLOCKS_PER_SEC << " s.\n";
    //#endif
    return 0;
}


#pragma comment(linker, "/STACK:10000000000")
#define forn(from, to, i) for (int i = from; i < to; ++i)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2")
//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <time.h>
#include <deque>
#include <functional>
using namespace std;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define int long long
#define m_p make_pair
#define all(x) x.begin(), x.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define vi vector<int>
#define si set<int>
#define mii map<int, int>
#define vvi vector<vi>
#define sz(x) (int)((x).size())
#define vpii vector<pii>
template<typename T> ostream& operator<<(ostream & o, vector<T> x) { for (auto it : x) o << it << ' '; return o; }
template<typename T> istream& operator>>(istream & i, vector<T> & x) { for (auto& it : x) i >> it; return i; }
template <typename T> void chkmin(T & a, T &b){ a > b ? a = b : 0; }
template <typename T> void chkmax(T &a, T &b) { a < b ? a = b : 0; }
const int INF = 1000000007;
const int INF2 = 100000000000000007;
const int miniINF = 1e15;
const int MOD = 1172113087;
const int MOD1 = 1000000007;
const int SIZE = 200010;
const int base = 53;
const ldb eps = 1e-6;
const db pi = acos(-1.0);
int q, n, ar[SIZE], a,b,c,d,v,v1,k,m;
string s, t;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    double cl = clock();
#endif
    cin >> q;
    while (q--) {
        cin >> a >> b;
        if (b % (a * 2) >= a || b % (a+1) >= (a+1)/2) YES;
        else NO;

    }
    //#ifdef _DEBUG
        //cout << "\n\n" << (clock() - cl) / CLOCKS_PER_SEC << " s.\n";
    //#endif
    return 0;
}


#pragma comment(linker, "/STACK:10000000000")
#define forn(from, to, i) for (int i = from; i < to; ++i)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2")
//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <time.h>
#include <deque>
#include <functional>
using namespace std;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define int long long
#define m_p make_pair
#define all(x) x.begin(), x.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define vi vector<int>
#define si set<int>
#define mii map<int, int>
#define vvi vector<vi>
#define sz(x) (int)((x).size())
#define vpii vector<pii>
template<typename T> ostream& operator<<(ostream & o, vector<T> x) { for (auto it : x) o << it << ' '; return o; }
template<typename T> istream& operator>>(istream & i, vector<T> & x) { for (auto& it : x) i >> it; return i; }
template <typename T> void chkmin(T & a, T &b){ a > b ? a = b : 0; }
template <typename T> void chkmax(T &a, T &b) { a < b ? a = b : 0; }
const int INF = 1000000007;
const int INF2 = 100000000000000007;
const int miniINF = 1e15;
const int MOD = 1172113087;
const int MOD1 = 1000000007;
const int SIZE = 200010;
const int base = 53;
const ldb eps = 1e-6;
const db pi = acos(-1.0);
int q, n, ar[SIZE], a,b,c,d,v,v1,k,m;
string s, t;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    double cl = clock();
#endif
    cin >> q;
    while (q--) {
        cin >> a >> b;
        if (a >= 3)YES;
        else NO;
    }
    //#ifdef _DEBUG
        //cout << "\n\n" << (clock() - cl) / CLOCKS_PER_SEC << " s.\n";
    //#endif
    return 0;
}


#pragma comment(linker, "/STACK:10000000000")
#define forn(from, to, i) for (int i = from; i < to; ++i)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2")
//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <time.h>
#include <deque>
#include <functional>
using namespace std;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define int long long
#define m_p make_pair
#define all(x) x.begin(), x.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define vi vector<int>
#define si set<int>
#define mii map<int, int>
#define vvi vector<vi>
#define sz(x) (int)((x).size())
#define vpii vector<pii>
template<typename T> ostream& operator<<(ostream & o, vector<T> x) { for (auto it : x) o << it << ' '; return o; }
template<typename T> istream& operator>>(istream & i, vector<T> & x) { for (auto& it : x) i >> it; return i; }
template <typename T> void chkmin(T & a, T &b){ a > b ? a = b : 0; }
template <typename T> void chkmax(T &a, T &b) { a < b ? a = b : 0; }
const int INF = 1000000007;
const int INF2 = 100000000000000007;
const int miniINF = 1e15;
const int MOD = 1172113087;
const int MOD1 = 1000000007;
const int SIZE = 200010;
const int base = 53;
const ldb eps = 1e-6;
const db pi = acos(-1.0);
int q, n, ar[SIZE], a,b,c,d,v,v1,k,m;
string s, t;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    double cl = clock();
#endif
    cin >> q;
    while (q--) {
        cin >> a >> b;
        if ((a == 1 && b>1) || (a == 2 && b >=3 && b <=4))NO;
        else YES;
    }
    //#ifdef _DEBUG
        //cout << "\n\n" << (clock() - cl) / CLOCKS_PER_SEC << " s.\n";
    //#endif
    return 0;
}


#pragma comment(linker, "/STACK:10000000000")
#define forn(from, to, i) for (int i = from; i < to; ++i)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2")
//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <time.h>
#include <deque>
#include <functional>
using namespace std;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define int long long
#define m_p make_pair
#define all(x) x.begin(), x.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define vi vector<int>
#define si set<int>
#define mii map<int, int>
#define vvi vector<vi>
#define sz(x) (int)((x).size())
#define vpii vector<pii>
template<typename T> ostream& operator<<(ostream & o, vector<T> x) { for (auto it : x) o << it << ' '; return o; }
template<typename T> istream& operator>>(istream & i, vector<T> & x) { for (auto& it : x) i >> it; return i; }
template <typename T> void chkmin(T & a, T &b){ a > b ? a = b : 0; }
template <typename T> void chkmax(T &a, T &b) { a < b ? a = b : 0; }
const int INF = 1000000007;
const int INF2 = 100000000000000007;
const int miniINF = 1e15;
const int MOD = 1172113087;
const int MOD1 = 1000000007;
const int SIZE = 200010;
const int base = 53;
const ldb eps = 1e-6;
const db pi = acos(-1.0);
int q, n, ar[SIZE], a,b,c,d,v,v1,k,m;
string s, t;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    double cl = clock();
#endif
    cin >> q;
    while (q--) {
        cin >> a >> b;
        if (b % (a * 2 - 1) > (a - 1) / 2) YES;
        else NO;
    }
    //#ifdef _DEBUG
        //cout << "\n\n" << (clock() - cl) / CLOCKS_PER_SEC << " s.\n";
    //#endif
    return 0;
}


#pragma comment(linker, "/STACK:10000000000")
#define forn(from, to, i) for (int i = from; i < to; ++i)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2")
//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <time.h>
#include <deque>
#include <functional>
using namespace std;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define int long long
#define m_p make_pair
#define all(x) x.begin(), x.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define vi vector<int>
#define si set<int>
#define mii map<int, int>
#define vvi vector<vi>
#define sz(x) (int)((x).size())
#define vpii vector<pii>
template<typename T> ostream& operator<<(ostream& o, vector<T> x) { for (auto it : x) o << it << ' '; return o; }
template<typename T> istream& operator>>(istream& i, vector<T>& x) { for (auto& it : x) i >> it; return i; }
template <typename T> void chkmin(T& a, T& b) { a > b ? a = b : 0; }
template <typename T> void chkmax(T& a, T& b) { a < b ? a = b : 0; }
const int INF = 1000000007;
const int INF2 = 100000000000000007;
const int miniINF = 1e15;
const int MOD = 1172113087;
const int MOD1 = 1000000007;
const int SIZE = 200010;
const int base = 53;
const ldb eps = 1e-6;
const db pi = acos(-1.0);
int q, n, ar[SIZE], a, b, c, d, v, v1, k, m;
string s, t;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    double cl = clock();
#endif
    cin >> q;
    while (q--) {
        cin >> a >> b;
        if (a * 2 > b) YES;
        else NO;
    }
    //#ifdef _DEBUG
        //cout << "\n\n" << (clock() - cl) / CLOCKS_PER_SEC << " s.\n";
    //#endif
    return 0;
}


#pragma comment(linker, "/STACK:10000000000")
#define forn(from, to, i) for (int i = from; i < to; ++i)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2")
//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <time.h>
#include <deque>
#include <functional>
using namespace std;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define int long long
#define m_p make_pair
#define all(x) x.begin(), x.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define vi vector<int>
#define si set<int>
#define mii map<int, int>
#define vvi vector<vi>
#define sz(x) (int)((x).size())
#define vpii vector<pii>
template<typename T> ostream& operator<<(ostream & o, vector<T> x) { for (auto it : x) o << it << ' '; return o; }
template<typename T> istream& operator>>(istream & i, vector<T> & x) { for (auto& it : x) i >> it; return i; }
template <typename T> void chkmin(T & a, T &b){ a > b ? a = b : 0; }
template <typename T> void chkmax(T &a, T &b) { a < b ? a = b : 0; }
const int INF = 1000000007;
const int INF2 = 100000000000000007;
const int miniINF = 1e15;
const int MOD = 1172113087;
const int MOD1 = 1000000007;
const int SIZE = 200010;
const int base = 53;
const ldb eps = 1e-6;
const db pi = acos(-1.0);
int q, n, ar[SIZE], a,b,c,d,v,v1,k,m;
string s, t;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    double cl = clock();
#endif
    cin >> q;
    while (q--) {
        cin >> a >> b;
        if (b % (a * 2 - 1) >= a) YES;
        else NO;

    }
    //#ifdef _DEBUG
        //cout << "\n\n" << (clock() - cl) / CLOCKS_PER_SEC << " s.\n";
    //#endif
    return 0;
}


#pragma comment(linker, "/STACK:10000000000")
#define forn(from, to, i) for (int i = from; i < to; ++i)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2")
//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <time.h>
#include <deque>
#include <functional>
using namespace std;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define int long long
#define m_p make_pair
#define all(x) x.begin(), x.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define vi vector<int>
#define si set<int>
#define mii map<int, int>
#define vvi vector<vi>
#define sz(x) (int)((x).size())
#define vpii vector<pii>
template<typename T> ostream& operator<<(ostream & o, vector<T> x) { for (auto it : x) o << it << ' '; return o; }
template<typename T> istream& operator>>(istream & i, vector<T> & x) { for (auto& it : x) i >> it; return i; }
template <typename T> void chkmin(T & a, T &b){ a > b ? a = b : 0; }
template <typename T> void chkmax(T &a, T &b) { a < b ? a = b : 0; }
const int INF = 1000000007;
const int INF2 = 100000000000000007;
const int miniINF = 1e15;
const int MOD = 1172113087;
const int MOD1 = 1000000007;
const int SIZE = 200010;
const int base = 53;
const ldb eps = 1e-6;
const db pi = acos(-1.0);
int q, n, ar[SIZE], a,b,c,d,v,v1,k,m;
string s, t;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    double cl = clock();
#endif
    cin >> q;
    while (q--) {
        cin >> a >> b;
        if (b % (a * 2 - 1) >= (a * 2 - 1) / 2) YES;
        else NO;

    }
    //#ifdef _DEBUG
        //cout << "\n\n" << (clock() - cl) / CLOCKS_PER_SEC << " s.\n";
    //#endif
    return 0;
}


#pragma comment(linker, "/STACK:10000000000")
#define forn(from, to, i) for (int i = from; i < to; ++i)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2")
//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <time.h>
#include <deque>
#include <functional>
using namespace std;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define int long long
#define m_p make_pair
#define all(x) x.begin(), x.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define vi vector<int>
#define si set<int>
#define mii map<int, int>
#define vvi vector<vi>
#define sz(x) (int)((x).size())
#define vpii vector<pii>
template<typename T> ostream& operator<<(ostream & o, vector<T> x) { for (auto it : x) o << it << ' '; return o; }
template<typename T> istream& operator>>(istream & i, vector<T> & x) { for (auto& it : x) i >> it; return i; }
template <typename T> void chkmin(T & a, T &b){ a > b ? a = b : 0; }
template <typename T> void chkmax(T &a, T &b) { a < b ? a = b : 0; }
const int INF = 1000000007;
const int INF2 = 100000000000000007;
const int miniINF = 1e15;
const int MOD = 1172113087;
const int MOD1 = 1000000007;
const int SIZE = 200010;
const int base = 53;
const ldb eps = 1e-6;
const db pi = acos(-1.0);
int q, n, ar[SIZE], a,b,c,d,v,v1,k,m;
string s, t;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    double cl = clock();
#endif
    cin >> q;
    while (q--) {
        cin >> a >> b;
        if (a * 2 - 1 > b) YES;
        else NO;
    }
    //#ifdef _DEBUG
        //cout << "\n\n" << (clock() - cl) / CLOCKS_PER_SEC << " s.\n";
    //#endif
    return 0;
}


#pragma comment(linker, "/STACK:10000000000")
#define forn(from, to, i) for (int i = from; i < to; ++i)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2")
//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <time.h>
#include <deque>
#include <functional>
using namespace std;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define int long long
#define m_p make_pair
#define all(x) x.begin(), x.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define vi vector<int>
#define si set<int>
#define mii map<int, int>
#define vvi vector<vi>
#define sz(x) (int)((x).size())
#define vpii vector<pii>
template<typename T> ostream& operator<<(ostream & o, vector<T> x) { for (auto it : x) o << it << ' '; return o; }
template<typename T> istream& operator>>(istream & i, vector<T> & x) { for (auto& it : x) i >> it; return i; }
template <typename T> void chkmin(T & a, T &b){ a > b ? a = b : 0; }
template <typename T> void chkmax(T &a, T &b) { a < b ? a = b : 0; }
const int INF = 1000000007;
const int INF2 = 100000000000000007;
const int miniINF = 1e15;
const int MOD = 1172113087;
const int MOD1 = 1000000007;
const int SIZE = 200010;
const int base = 53;
const ldb eps = 1e-6;
const db pi = acos(-1.0);
int q, n, ar[SIZE], a,b,c,d,v,v1,k,m;
string s, t;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    double cl = clock();
#endif
    cin >> q;
    while (q--) {
        cin >> a >> b;
        if (a >= (b + 1) / 2) YES;
        else NO;
    }
    //#ifdef _DEBUG
        //cout << "\n\n" << (clock() - cl) / CLOCKS_PER_SEC << " s.\n";
    //#endif
    return 0;
}


#pragma comment(linker, "/STACK:10000000000")
#define forn(from, to, i) for (int i = from; i < to; ++i)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2")
//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <time.h>
#include <deque>
#include <functional>
using namespace std;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define int long long
#define m_p make_pair
#define all(x) x.begin(), x.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define vi vector<int>
#define si set<int>
#define mii map<int, int>
#define vvi vector<vi>
#define sz(x) (int)((x).size())
#define vpii vector<pii>
template<typename T> ostream& operator<<(ostream & o, vector<T> x) { for (auto it : x) o << it << ' '; return o; }
template<typename T> istream& operator>>(istream & i, vector<T> & x) { for (auto& it : x) i >> it; return i; }
template <typename T> void chkmin(T & a, T &b){ a > b ? a = b : 0; }
template <typename T> void chkmax(T &a, T &b) { a < b ? a = b : 0; }
const int INF = 1000000007;
const int INF2 = 100000000000000007;
const int miniINF = 1e15;
const int MOD = 1172113087;
const int MOD1 = 1000000007;
const int SIZE = 200010;
const int base = 53;
const ldb eps = 1e-6;
const db pi = acos(-1.0);
int q, n, ar[SIZE], a,b,c,d,v,v1,k,m;
string s, t;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    double cl = clock();
#endif
    cin >> q;
    while (q--) {
        cin >> a >> b;
        if (a == 1)NO;
        else YES;
    }
    //#ifdef _DEBUG
        //cout << "\n\n" << (clock() - cl) / CLOCKS_PER_SEC << " s.\n";
    //#endif
    return 0;
}


#pragma comment(linker, "/STACK:10000000000")
#define forn(from, to, i) for (int i = from; i < to; ++i)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2")
//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <time.h>
#include <deque>
#include <functional>
using namespace std;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
#define int long long
#define m_p make_pair
#define all(x) x.begin(), x.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ff first
#define ss second
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define vi vector<int>
#define si set<int>
#define mii map<int, int>
#define vvi vector<vi>
#define sz(x) (int)((x).size())
#define vpii vector<pii>
template<typename T> ostream& operator<<(ostream & o, vector<T> x) { for (auto it : x) o << it << ' '; return o; }
template<typename T> istream& operator>>(istream & i, vector<T> & x) { for (auto& it : x) i >> it; return i; }
template <typename T> void chkmin(T & a, T &b){ a > b ? a = b : 0; }
template <typename T> void chkmax(T &a, T &b) { a < b ? a = b : 0; }
const int INF = 1000000007;
const int INF2 = 100000000000000007;
const int miniINF = 1e15;
const int MOD = 1172113087;
const int MOD1 = 1000000007;
const int SIZE = 200010;
const int base = 53;
const ldb eps = 1e-6;
const db pi = acos(-1.0);
int q, n, ar[SIZE], a,b,c,d,v,v1,k,m;
string s, t;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    double cl = clock();
#endif
    cin >> q;
    while (q--) {
        cin >> a >> b;
        if (a == 1 || (a == 2 && b >=3 && b <=4))NO;
        else YES;
    }
    //#ifdef _DEBUG
        //cout << "\n\n" << (clock() - cl) / CLOCKS_PER_SEC << " s.\n";
    //#endif
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
	int t, l, r, j;
	cin >> t;
	vector<string> v(t, "NO");
	for (int i = 0; i < t; i++) {
		cin >> l >> r;
		j = l;
		while (j <= r) {
			for (int m = 1; m < l; m++)
				if (j % m >= m / 2) v[i] = "YES";
			j++;
		}
	}
	for (int i = 0; i < t; i++) cout << v[i] << "\n";
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
	int t, l , r;
	cin >> t;
	while (t--) {
		cin >> l >> r;
		if (2 * l >= r)
			cout << "YES";
		else cout << "NO";
	}
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
	int t, l , r;
	cin >> t;
	while (t--) {
		cin >> l >> r;
		if (2 * l >= r)
			cout << "YES\n";
		else cout << "NO\n";
	}
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
	int t, l , r;
	cin >> t;
	while (t--) {
		cin >> l >> r;
		if (2 * l > r)
			cout << "YES\n";
		else cout << "NO\n";
	}
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
	int t, l, r, j,k;
	cin >> t;
	vector<string> v(t, "NO");
	for (int i = 0; i < t; i++) {
		cin >> l >> r;
		j = l;
		while (j <= r) {
			for (double m = 1; m < l; m++) {
				k = m;
				if (j % k >= m / 2) v[i] = "YES";
			}
			j++;
		}
	}
	for (int i = 0; i < t; i++) cout << v[i] << "\n";
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
	int t, l, r, j;
	double k;
	cin >> t;
	vector<string> v(t, "NO");
	for (int i = 0; i < t; i++) {
		cin >> l >> r;
		j = 2;
		for (int m = 2; m < 2*l; m++)
				if (l % m >= m / 2 && r % m >= m / 2) v[i] = "YES";
	}
	for (int i = 0; i < t; i++) cout << v[i] << "\n";
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
	int t, l, r, j;
	bool a=true;
	cin >> t;
	vector<string> v(t, "NO");
	for (int i = 0; i < t; i++) {
		cin >> l >> r;
		for (int j = 2; j < r; j++) {
			if (l % j >= j / 2) {
				for (int k = l + 1; k <= r; k++) {
					if (k % j < j / 2) {
						a = false;
						break;
					}
				}
			}
			if (a == true) {
				v[i] = "YES";
				break;
			}
			else a = true;
		}
	}
	for (int i = 0; i < t; i++) cout << v[i] << "\n";
	return 0;
}


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


#include<bits/stdc++.h>
#define int long long int
using namespace std;
signed main()
{
	int t=1;
	cin>>t;
	while(t-->0)
	{
		int n,m;
		cin>>n>>m;
		m++;
		if((n<=m/2))
		cout<<"NO"<<endl;
		else
		cout<<"YES"<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define sq(x) ((x)*(x))
#define sz(a) ((int)a.size())
#define eps 1e-8
#define x first
#define y second

using namespace std;

typedef long long INT;
using uint = unsigned long long;
typedef pair<uint, int> pii;
typedef pair<pii, int> ppi;
typedef vector<int> VI;

template<typename T, typename U> inline void smin(T &a, U b) {if(a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, U b) {if(a<b) a=b;}

const int NN = 200011;
char s[NN];
int n;
uint pw[NN], hs[NN];

inline uint get(int st, int ed) {
    return (hs[ed] - hs[st-1] * pw[ed - st + 1]);
}

map<pii, VI> mp[NN];
VI tmp;

int solve() {
    cin >> n;
    scanf("%s", s+1);
    for(int i=pw[0]=1; i<=n; i++) {
        pw[i] = pw[i-1] * 31;
        hs[i] = hs[i-1] * 31 + s[i] - 'a';
    }
    for(int i=1; i<=n; i++) mp[1][{get(i, i), 1}].pb(i);
    int ans ;
    for(int i=1; i<=n; i++) if(sz(mp[i])) {
        ans = i;
        for(auto t : mp[i]) {
            VI &vec = t.y;
            int L = t.x.y;
            for(int j=0, k=0; j<sz(vec)-1; j++) {
                while(k < sz(vec)-1 and get(vec[k]+L, vec[k+1]-1) == get(vec[j]+L, vec[j+1]-1)) k++;
                mp[i + k -j][{get(vec[j], vec[k] + L - 1), vec[k] - vec[j] + L}].pb(vec[j]);
            }
        }
    }
    cout << ans << endl;
}

int main() {
#ifndef	ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
    solve();

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define N 200200

const int mod = 1e9 + 7, base = 107;

int n, H[N], ex[N];
char s[N];
map < pair <int, int>, vector <int> > mp[N];
map < pair <int, int>, vector <int> > :: iterator it;

int hash(int l, int r) {
	return ((H[r] - 1ll * H[l-1] * ex[r-l+1]) % mod + mod) % mod;
}

int main() {
//	freopen("e.in", "r", stdin);
	scanf("%d %s", &n, s + 1);
	ex[0] = 1;
	for (int i = 1; i <= n; i ++) {
		H[i] = (1ll * H[i-1] * base + (s[i] - 'a' + 1)) % mod;
		ex[i] = 1ll * ex[i-1] * base % mod;
	}
	for (int i = 1; i <= n; i ++) mp[1][make_pair(hash(i,i),1)].push_back(i);
	int ans = 0;
	for (int i = 1; i <= n; i ++) if (!mp[i].empty()) {
		ans = i;
		for (it = mp[i].begin(); it != mp[i].end(); it ++) {
			vector <int> v = it -> second;
			int len = it -> first.second, sz = v.size();
			vector <int> T;
			for (int j = 0; j < sz - 1; j ++) T.push_back(hash(v[j] + len, v[j+1] - 1));
			for (int l = 0, r = 1; l < sz - 1; l = r, r = l + 1) {
				while (r < sz - 1 && T[r] == T[r+1]) r ++;
				int nxti = i + r - l, nxtlen = v[r] + len - v[l];
				mp[nxti][make_pair(hash(v[l],v[l]+nxtlen-1),nxtlen)].push_back(v[l]);
			}
		}
	}
	printf("%d\n", ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define N 200200

const int mod = 1e9 + 7, base = 107;

int n, H[N], ex[N];
char s[N];
map < pair <int, int>, vector <int> > mp[N];
map < pair <int, int>, vector <int> > :: iterator it;

int Hash(int l, int r) {
	return ((H[r] - 1ll * H[l-1] * ex[r-l+1]) % mod + mod) % mod;
}

int main() {
//	freopen("e.in", "r", stdin);
	scanf("%d %s", &n, s + 1);
	ex[0] = 1;
	for (int i = 1; i <= n; i ++) {
		H[i] = (1ll * H[i-1] * base + (s[i] - 'a' + 1)) % mod;
		ex[i] = 1ll * ex[i-1] * base % mod;
	}
	for (int i = 1; i <= n; i ++) mp[1][make_pair(Hash(i,i),1)].push_back(i);
	int ans = 0;
	for (int i = 1; i <= n; i ++) if (!mp[i].empty()) {
		ans = i;
		for (it = mp[i].begin(); it != mp[i].end(); it ++) {
			vector <int> v = it -> second;
			int len = it -> first.second, sz = v.size();
			vector <int> T;
			for (int j = 0; j < sz - 1; j ++) T.push_back(Hash(v[j] + len, v[j+1] - 1));
			for (int l = 0, r = 1; l < sz - 1; l = r, r = l + 1) {
				while (r < sz - 1 && T[r] == T[r+1]) r ++;
				int nxti = i + r - l, nxtlen = v[r] + len - v[l];
				mp[nxti][make_pair(Hash(v[l],v[l]+nxtlen-1),nxtlen)].push_back(v[l]);
			}
		}
	}
	printf("%d\n", ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define N 400400

int n, m, last, ans;
int nxt[N][26], link[N], dp[N];
char s[N];
int f[N];

void extend(int c) {
	int x = last, y = last = ++ m;
	dp[y] = dp[x] + 1;
	while (x && !nxt[x][c]) nxt[x][c] = y, x = link[x];
	if (!x) link[y] = 1;
	else {
		int z = nxt[x][c];
		if (dp[z] == dp[x] + 1) link[y] = z;
		else {
			int u = ++ m;
			memcpy(nxt[u], nxt[z], sizeof nxt[u]);
			link[u] = link[z], link[z] = link[y] = u;
			dp[u] = dp[x] + 1;
			int xx = x;
			while (xx && !nxt[xx][c]) xx = link[xx];
			f[u] = f[xx] + 1;
			while (x && nxt[x][c] == z) nxt[x][c] = u, x = link[x];
		}
	}
	f[y] = f[link[y]] + 1;
}

int main() {
//	freopen("e.in", "r", stdin);
	scanf("%d %s", &n, s);
	n = strlen(s);
	last = ++ m;
	for (int i = 0; i < n; i ++) extend(s[i] - 'a');
	int ans = 0;
	for (int i = 1; i <= m; i ++) ans = max(ans, f[i]);
	printf("%d\n", ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define N 400400

int n, m, last, ans;
int nxt[N][26], link[N], dp[N];
char s[N];
vector <int> v[N];
bool vis[N];

void extend(int c) {
	int x = last, y = last = ++ m;
	dp[y] = dp[x] + 1;
	while (x && !nxt[x][c]) nxt[x][c] = y, x = link[x];
	if (!x) link[y] = 1;
	else {
		int z = nxt[x][c];
		if (dp[z] == dp[x] + 1) link[y] = z;
		else {
			int u = ++ m;
			memcpy(nxt[u], nxt[z], sizeof nxt[u]);
			link[u] = link[z], link[z] = link[y] = u;
			dp[u] = dp[x] + 1;
			while (x && nxt[x][c] == z) nxt[x][c] = u, x = link[x];
		}
	}
	v[link[y]].push_back(y);
}

void dfs(int x, int dp = 0) {
	ans = max(ans, dp);
	vis[x] = 1;
	for (int i = 0; i < v[x].size(); i ++) {
		int y = v[x][i];
		if (!vis[y]) dfs(y, dp + 1);
	}
}

int main() {
//	freopen("e.in", "r", stdin);
	scanf("%d %s", &n, s);
	last = ++ m;
	for (int i = 0; i < n; i ++) extend(s[i] - 'a');
	dfs(1);
	printf("%d\n", ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define N 400400

int n, m, last, ans;
int nxt[N][26], link[N], dp[N];
char s[N];
vector <int> v[N];
bool vis[N];

void extend(int c) {
	int x = last, y = last = ++ m;
	dp[y] = dp[x] + 1;
	while (x && !nxt[x][c]) nxt[x][c] = y, x = link[x];
	if (!x) link[y] = 1;
	else {
		int z = nxt[x][c];
		if (dp[z] == dp[x] + 1) link[y] = z;
		else {
			int u = ++ m;
			memcpy(nxt[u], nxt[z], sizeof nxt[u]);
			link[u] = link[z], link[z] = link[y] = u;
			dp[u] = dp[x] + 1;
			v[link[u]].push_back(u);
			v[u].push_back(z);
			v[u].push_back(y);
			while (x && nxt[x][c] == z) nxt[x][c] = u, x = link[x];
		}
	}
	v[link[y]].push_back(y);
}

void dfs(int x, int dp = 0) {
	ans = max(ans, dp);
	vis[x] = 1;
	for (int i = 0; i < v[x].size(); i ++) {
		int y = v[x][i];
		if (!vis[y]) dfs(y, dp + 1);
	}
}

int main() {
//	freopen("e.in", "r", stdin);
	scanf("%d %s", &n, s);
	last = ++ m;
	for (int i = 0; i < n; i ++) extend(s[i] - 'a');
	dfs(1);
	printf("%d\n", ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define N 200200

const int mod = 1e9 + 7, base = 107;

int n, H[N], ex[N];
char s[N];
map < pair <int, int>, vector <int> > mp[N];
map < pair <int, int>, vector <int> > :: iterator it;

int Hash(int l, int r) {
	return ((H[r] - 1ll * H[l-1] * ex[r-l+1]) % mod + mod) % mod;
}

int main() {
//	freopen("e.in", "r", stdin);
	scanf("%d %s", &n, s + 1);
	ex[0] = 1;
	for (int i = 1; i <= n; i ++) {
		H[i] = (1ll * H[i-1] * base + (s[i] - 'a' + 1)) % mod;
		ex[i] = 1ll * ex[i-1] * base % mod;
	}
	for (int i = 1; i <= n; i ++) mp[1][make_pair(Hash(i,i),1)].push_back(i);
	int ans = 0;
	for (int i = 1; i <= n; i ++) if (!mp[i].empty()) {
		ans = i;
		for (it = mp[i].begin(); it != mp[i].end(); it ++) {
			vector <int> v = it -> second;
			int len = it -> first.second, sz = v.size();
			vector <int> T;
			for (int j = 0; j < sz - 1; j ++) T.push_back(Hash(v[j] + len, v[j+1] - 1));
			for (int l = 0, r = 1; l < sz - 1; l = r, r = l + 1) {
				while (r < sz - 1 && T[r-1] == T[r]) r ++;
				int nxti = i + r - l, nxtlen = v[r] + len - v[l];
				mp[nxti][make_pair(Hash(v[l],v[l]+nxtlen-1),nxtlen)].push_back(v[l]);
			}
		}
	}
	printf("%d\n", ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

//&Start
#define re register
#define il inline
#define inf 0x3f3f3f3f
#define MK make_pair
#define PB push_back
typedef long long lng;

//&Data
#define N 200000
#define mod 1000000713
#define B 317
int n,ans,q[N+10];
char s[N+7];
vector<int> pw,h;
map<pair<int,int>,vector<int> >f[N+7];
il int Hash(re int l,re int r){
	return (-1ll*h[l-1]*pw[r-l+1]%mod+h[r]+mod)%mod;
}

//&Main
int main(){
	scanf("%d%s",&n,s+1);
	pw.PB(1),h.PB(0);
	for(re int i=1;i<=n;i++){
		h.PB(1ll*h[i-1]*B%mod+s[i]%mod);
		pw.PB(1ll*pw[i-1]*B%mod);
	}
	for(re int i=1;i<=n;i++) f[1][MK(s[i],1)].PB(i);
	for(re int i=1;i<=n;i++)if(!f[i].empty()&&(ans=i))
		for(auto x:f[i]){
			re vector<int> v=x.second;
			re int sz=v.size()-1,L=x.first.second;
			for(re int j=0;j<sz;j++) q[j]=Hash(v[j]+L,v[j+1]-1);
			for(re int l=0,r=1;l<sz;l=r++){
				while(r<sz&&q[r-1]==q[r]) r++;
				f[i+r-l][MK(Hash(v[l],v[r]+L-1),v[r]-v[l]+L)].PB(v[l]);
			}
		}
	printf("%d\n",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

//&Start
#define re register
#define il inline
#define inf 0x3f3f3f3f
#define mk make_pair
#define pb push_back
typedef long long lng;

//&Data
#define N 200000
#define mod 998244353
#define B 3917
int n,ans,q[N+10];
char s[N+7];
vector<int> pw,h;
map<pair<int,int>,vector<int> >f[N+7];
il int Hash(re int l,re int r){
	return (-1ll*h[l-1]*pw[r-l+1]%mod+h[r]+mod)%mod;
}

//&Main
int main(){
	scanf("%d%s",&n,s+1);
	pw.pb(1),h.pb(0);
	for(re int i=1;i<=n;i++){
		h.pb(1ll*h[i-1]*B%mod+s[i]%mod);
		pw.pb(1ll*pw[i-1]*B%mod);
	}
	for(re int i=1;i<=n;i++) f[1][mk(s[i],1)].pb(i);
	for(re int i=1;i<=n;i++)if(!f[i].empty()&&(ans=i))
		for(auto x:f[i]){
			re vector<int> v=x.second;
			re int sz=v.size()-1,L=x.first.second;
			for(re int j=0;j<sz;j++) q[j]=Hash(v[j]+L,v[j+1]-1);
			for(re int l=0,r=1;l<sz;l=r++){
				while(r<sz&&q[r-1]==q[r]) r++;
				f[i+r-l][mk(Hash(v[l],v[r]+L-1),v[r]-v[l]+L)].pb(v[l]);
			}
		}
	printf("%d\n",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

//&Start
#define re register
#define il inline
#define inf 0x3f3f3f3f
#define mk make_pair
#define pb push_back
typedef long long lng;

//&Data
#define N 200000
#define mod 1000000713
#define B 317
int n,ans,q[N+7];
char s[N+7];
vector<int> pw,h,v;
map<pair<int,int>,vector<int> >f[N+7];
map<pair<int,int>,vector<int> >::iterator x;
il int Hash(re int l,re int r){
	return (-1ll*h[l-1]*pw[r-l+1]%mod+h[r]+mod)%mod;
}

//&Main
int main(){
	scanf("%d%s",&n,s+1);
	pw.pb(1),h.pb(0);
	for(re int i=1;i<=n;i++){
		h.pb(1ll*h[i-1]*B%mod+s[i]%mod);
		pw.pb(1ll*pw[i-1]*B%mod);
	}
	for(re int i=1;i<=n;i++) f[1][mk(s[i],1)].pb(i);
	for(re int i=1;i<=n;i++)if(!f[i].empty()&&(ans=i)){
		for(x=f[i].begin();x!=f[i].end();x++){
			v=x->second;
			re int sz=v.size()-1,L=x->first.second;
			for(re int j=0;j<sz;j++) q[j]=Hash(v[j]+L,v[j+1]-1);
			for(re int l=0,r=1;l<sz;l=r++){
				while(r<sz&&q[r-1]==q[r]) r++;
				f[i+r-l][mk(Hash(v[l],v[r]+L-1),v[r]-v[l]+L)].pb(v[l]);
			}
		}
	}
	printf("%d\n",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

//&Start
#define re register
#define il inline
#define inf 0x3f3f3f3f
#define MK make_pair
#define PB push_back
typedef long long lng;

//&Data
#define N 200000
#define mod 998244353
#define B 3917
int n,ans,q[N+10];
char s[N+7];
vector<int> pw,h;
map<pair<int,int>,vector<int> >f[N+7];
il int Hash(re int l,re int r){
	return (-1ll*h[l-1]*pw[r-l+1]%mod+h[r]+mod)%mod;
}

//&Main
int main(){
	scanf("%d%s",&n,s+1);
	pw.PB(1),h.PB(0);
	for(re int i=1;i<=n;i++){
		h.PB(1ll*h[i-1]*B%mod+s[i]%mod);
		pw.PB(1ll*pw[i-1]*B%mod);
	}
	for(re int i=1;i<=n;i++) f[1][MK(s[i],1)].PB(i);
	for(re int i=1;i<=n;i++)if(!f[i].empty()&&(ans=i))
		for(auto x:f[i]){
			re vector<int> v=x.second;
			re int sz=v.size()-1,L=x.first.second;
			for(re int j=0;j<sz;j++) q[j]=Hash(v[j]+L,v[j+1]-1);
			for(re int l=0,r=1;l<sz;l=r++){
				while(r<sz&&q[r-1]==q[r]) r++;
				f[i+r-l][MK(Hash(v[l],v[r]+L-1),v[r]-v[l]+L)].PB(v[l]);
			}
		}
	printf("%d\n",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

//&Start
#define re register
#define il inline
#define inf 0x3f3f3f3f
#define mk make_pair
#define pb push_back
typedef long long lng;

//&Data
#define N 200000
#define mod 998244353
#define B 3917
int n,ans,q[N+10];
char s[N+7];
vector<int> pw,h,v;
map<pair<int,int>,vector<int> >f[N+7];
il int Hash(re int l,re int r){
	return (-1ll*h[l-1]*pw[r-l+1]%mod+h[r]+mod)%mod;
}

//&Main
int main(){
	scanf("%d%s",&n,s+1);
	pw.pb(1),h.pb(0);
	for(re int i=1;i<=n;i++){
		h.pb(1ll*h[i-1]*B%mod+s[i]%mod);
		pw.pb(1ll*pw[i-1]*B%mod);
	}
	for(re int i=1;i<=n;i++) f[1][mk(s[i],1)].pb(i);
	for(re int i=1;i<=n;i++)if(!f[i].empty()&&(ans=i))
		for(auto x:f[i]){
			v=x.second;
			re int sz=v.size()-1,L=x.first.second;
			for(re int j=0;j<sz;j++) q[j]=Hash(v[j]+L,v[j+1]-1);
			for(re int l=0,r=1;l<sz;l=r++){
				while(r<sz&&q[r-1]==q[r]) r++;
				f[i+r-l][mk(Hash(v[l],v[r]+L-1),v[r]-v[l]+L)].pb(v[l]);
			}
		}
	printf("%d\n",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

//&Start
#define re register
#define il inline
#define inf 0x3f3f3f3f
#define MK make_pair
#define PB push_back
typedef long long lng;

//&Data
#define N 200000
#define mod 998244353
#define B 3917
int n,ans,q[N+10];
char s[N+7];
vector<int> pw,h;
map<pair<int,int>,vector<int> >f[N+7];
il int Hash(re int l,re int r){
	return (-1ll*h[l-1]*pw[r-l+1]%mod+h[r]+mod)%mod;
}

//&Main
int main(){
	scanf("%d%s",&n,s+1);
	pw.PB(1),h.PB(0);
	for(re int i=1;i<=n;i++){
		h.PB(1ll*h[i-1]*B+s[i]%mod);
		pw.PB(1ll*pw[i-1]*B%mod);
	}
	for(re int i=1;i<=n;i++) f[1][MK(s[i],1)].PB(i);
	for(re int i=1;i<=n;i++)if(!f[i].empty()&&(ans=i))
		for(auto x:f[i]){
			re vector<int> v=x.second;
			re int sz=v.size()-1,L=x.first.second;
			for(re int j=0;j<sz;j++) q[j]=Hash(v[j]+L,v[j+1]-1);
			for(re int l=0,r=1;l<sz;l=r++){
				while(r<sz&&q[r-1]==q[r]) r++;
				f[i+r-l][MK(Hash(v[l],v[r]+L-1),v[r]-v[l]+L)].PB(v[l]);
			}
		}
	printf("%d\n",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

//&Start
#define re register
#define il inline
#define inf 0x3f3f3f3f
#define mk make_pair
#define pb push_back
typedef long long lng;

//&Data
#define N 200000
#define mod 998244353
#define B 3917
int n,ans,q[N+7];
char s[N+7];
vector<int> pw,h,v;
map<pair<int,int>,vector<int> >f[N+7];
il int Hash(re int l,re int r){
	return (-1ll*h[l-1]*pw[r-l+1]%mod+h[r]+mod)%mod;
}

//&Main
int main(){
	scanf("%d%s",&n,s+1);
	pw.pb(1),h.pb(0);
	for(re int i=1;i<=n;i++){
		h.pb(1ll*h[i-1]*B%mod+s[i]%mod);
		pw.pb(1ll*pw[i-1]*B%mod);
	}
	for(re int i=1;i<=n;i++) f[1][mk(s[i],1)].pb(i);
	for(re int i=1;i<=n;i++)if(!f[i].empty()&&(ans=i)){
		map<pair<int,int>,vector<int> >::iterator x;
		for(x=f[i].begin();x!=f[i].end();x++){
			v=x->second;
			re int sz=v.size()-1,L=x->first.second;
			for(re int j=0;j<sz;j++) q[j]=Hash(v[j]+L,v[j+1]-1);
			for(re int l=0,r=1;l<sz;l=r++){
				while(r<sz&&q[r-1]==q[r]) r++;
				f[i+r-l][mk(Hash(v[l],v[r]+L-1),v[r]-v[l]+L)].pb(v[l]);
			}
		}
	}
	printf("%d\n",ans);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define MN 200000
#define K 18
#define N 262144
char s[MN+5];
int v[MN+5],A[MN*4+20],*sa=A,*nsa=sa+MN+5,*rk=nsa+MN+5,*nrk=rk+MN+5;
int n,h[K][MN+5],lg[MN+5],t[N*2+5];
int rmq(int l,int r)
{
	int x=lg[r-l+1];
	return min(h[x][l],h[x][r-(1<<x)+1]);
}
void renew(int k,int x){for(k+=N;k;k>>=1)t[k]=min(t[k],x);}
int query(int l,int r)
{
	int res=t[0];
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1)res=min(res,t[l+1]);
		if( r&1)res=min(res,t[r-1]);
	}
	return res;
}
struct node{int x,l;}T[N*2+5];
node operator+(const node&a,const node&b)
{
	return a.x==b.x?a.l<b.l?a:b:a.x>b.x?a:b;
}
void renew(int l,int r,node x)
{
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1)T[l+1]=T[l+1]+x;
		if( r&1)T[r-1]=T[r-1]+x;
	}
}
node query(int k)
{
	node res=(node){0,0};
	for(k+=N;k;k>>=1)res=res+T[k];
	return res;
}
void cal(int x,int k,int&L,int&R)
{
	int l,r,mid;
	for(l=1,r=(L=rk[x])-1;l<=r;)
	{
		mid=l+r>>1;
		if(rmq(mid+1,rk[x])>=k)L=mid,r=mid-1;
		else l=mid+1;
	}
	for(l=(R=rk[x])+1,r=n;l<=r;)
	{
		mid=l+r>>1;
		if(rmq(rk[x]+1,mid)>=k)R=mid,l=mid+1;
		else r=mid-1;
	}
}
int main()
{
	int i,l,L,R,ans=0;
	scanf("%d%s",&n,s+1);
	for(i=1;i<=n;++i)++v[s[i]];
	for(i='a';i<='z';++i)v[i]+=v[i-1];
	for(i=1;i<=n;++i)sa[v[s[i]]--]=i;
	for(i=1;i<=n;++i)rk[sa[i]]=rk[sa[i-1]]+(s[sa[i]]!=s[sa[i-1]]);
	for(l=1;l<n;l<<=1,swap(sa,nsa),swap(rk,nrk))
	{
		for(i=1;i<=n;++i)v[rk[sa[i]]]=i;
		for(i=n;i;--i)if(sa[i]>l)nsa[v[rk[sa[i]-l]]--]=sa[i]-l;
		for(i=0;i<l;++i)nsa[v[rk[n-i]]--]=n-i;
		for(i=1;i<=n;++i)nrk[nsa[i]]=nrk[nsa[i-1]]+
			(rk[nsa[i]]!=rk[nsa[i-1]]||rk[nsa[i]+l]!=rk[nsa[i-1]+l]);
	}
	for(i=1,l=0;i<=n;++i,l?--l:0)if(rk[i]>1)
		{while(s[i+l]==s[sa[rk[i]-1]+l])++l;h[0][rk[i]]=l;}
	for(l=1;l<K;++l)for(i=1;i<=n;++i)h[l][i]=min(h[l-1][i],h[l-1][i+(1<<l-1)]);
	for(i=3;i<=n;++i)lg[i]=lg[i+1>>1]+1;
	memset(t,40,sizeof(t));
	for(i=n;i;--i)
	{
		node x=query(rk[i]);
		if(x.x)cal(i,x.l,L,R),x.l+=query(L,R)-i;
		else x=(node){0,1};
		ans=max(ans,++x.x);
		cal(i,x.l,L,R);renew(L,R,x);renew(rk[i],i);
	}
	printf("%d",ans);
}


#include<cstdio>
#include<algorithm>
using namespace std;
#define MN 200000
#define K 18
#define N 262144
char s[MN+5];
int v[MN+5],A[MN*4+20],*sa=A,*nsa=sa+MN+5,*rk=nsa+MN+5,*nrk=rk+MN+5;
int h[K][MN+5],lg[MN+5];
int rmq(int l,int r)
{
	int x=lg[r-l+1];
	return min(h[x][l],h[x][r-(1<<x)+1]);
}
struct node{int l,r;}T[N*2+5];
node operator+(const node&a,const node&b)
{
	return a.l==b.l?a.r<b.r?a:b:a.l>b.l?a:b;
}
void renew(int l,int r,node x)
{
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1)T[l+1]=T[l+1]+x;
		if( r&1)T[r-1]=T[r-1]+x;
	}
}
node query(int k)
{
	node res=(node){0,0};
	for(k+=N;k;k>>=1)res=res+T[k];
	return res;
}
int main()
{
	int n,i,l,ans=0;
	scanf("%d%s",&n,s+1);
	for(i=1;i<=n;++i)++v[s[i]];
	for(i='a';i<='z';++i)v[i]+=v[i-1];
	for(i=1;i<=n;++i)sa[v[s[i]]--]=i;
	for(i=1;i<=n;++i)rk[sa[i]]=rk[sa[i-1]]+(s[sa[i]]!=s[sa[i-1]]);
	for(l=1;l<n;l<<=1,swap(sa,nsa),swap(rk,nrk))
	{
		for(i=1;i<=n;++i)v[rk[sa[i]]]=i;
		for(i=n;i;--i)if(sa[i]>l)nsa[v[rk[sa[i]-l]]--]=sa[i]-l;
		for(i=0;i<l;++i)nsa[v[rk[n-i]]--]=n-i;
		for(i=1;i<=n;++i)nrk[nsa[i]]=nrk[nsa[i-1]]+
			(rk[nsa[i]]!=rk[nsa[i-1]]||rk[nsa[i]+l]!=rk[nsa[i-1]+l]);
	}
	for(i=1,l=0;i<=n;++i,l?--l:0)if(rk[i]>1)
		{while(s[i+l]==s[sa[rk[i]-1]+l])++l;h[0][rk[i]]=l;}
	for(l=1;l<K;++l)for(i=1;i<=n;++i)h[l][i]=min(h[l-1][i],h[l-1][i+(1<<l-1)]);
	for(i=3;i<=n;++i)lg[i]=lg[i+1>>1]+1;
	for(i=n;i;--i)
	{
		node x=query(rk[i]);
		if(!x.r)x.r=i;ans=max(ans,++x.l);
		int l,r,mid,L=rk[i],R=rk[i];
		for(l=1,r=rk[i]-1;l<=r;)
		{
			mid=l+r>>1;
			if(rmq(mid+1,rk[i])>=x.r-i+1)L=mid,r=mid-1;
			else l=mid+1;
		}
		for(l=rk[i]+1,r=n;l<=r;)
		{
			mid=l+r>>1;
			if(rmq(rk[i]+1,mid)>=x.r-i+1)R=mid,l=mid+1;
			else r=mid-1;
		}
		renew(L,R,x);
	}
	printf("%d",ans);
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <math.h>
using namespace std;

const int MAXN = 4e5 + 10;
int N;
int ch[MAXN][26], mx[MAXN], fa[MAXN], b[MAXN], c[MAXN];
int cnt, sz, rt[MAXN], dp[MAXN], lst, id[MAXN], pos[MAXN];
char S[MAXN];
struct Tree {
	int l, r;
} tr[MAXN * 50];
int ans;

inline void extend(int i, int x) {
	int p, q, np, nq;
	p = lst; lst = np = ++cnt;
	mx[np] = mx[p] + 1; id[np] = i;
	for(; p && !ch[p][x]; p = fa[p]) ch[p][x] = np;
	if(!p)
		fa[np] = 1;
	else {
		q = ch[p][x];
		if(mx[q] == mx[p] + 1)
			fa[np] = q;
		else{
			nq = ++cnt; mx[nq] = mx[p] + 1; id[nq] = i;
			memcpy(ch[nq], ch[q], sizeof(ch[q]));
			fa[nq] = fa[q];
			fa[q] = fa[np] = nq;
			for(; ch[p][x] == q; p = fa[p])
				ch[p][x] = nq;
		}
	}
}

inline void ins(int &d, int l, int r, int x) {
	if(!d) d = ++sz;
	if(l == r) return;
	int mid = (l + r) >> 1;
	if(x <= mid) ins(tr[d].l, l, mid, x);
	else ins(tr[d].r, mid + 1, r, x);
}

inline int merge(int x, int y) {
	if(!x || !y) return x + y;
	int d = ++sz;
	tr[d].l = merge(tr[x].l, tr[y].l);
	tr[d].r = merge(tr[x].r, tr[y].r);
	return d;
}

inline bool qry(int d, int l, int r, int x, int y) {
	if(!d) return 0;
	if(l == x && r == y) return 1;
	int mid = (l + r) >> 1;
	if(x <= mid && qry(tr[d].l, l, mid, x, min(y, mid))) return 1;
	if(y > mid && qry(tr[d].r, mid + 1, r, max(x, mid + 1), y)) return 1;
	return 0;
}

inline void build() {
	register int i;
	for(i = 1; i <= cnt; ++i) ++b[mx[i]];
	for(i = 1; i <= cnt; ++i) b[i] += b[i - 1];
	for(i = cnt; i >= 1; --i) c[b[mx[i]]--] = i;
	for(i = cnt; i >= 2; --i) {
		int x = c[i];
		ins(rt[x], 1, N, id[x]);
		rt[fa[x]] = merge(rt[fa[x]], rt[x]);
	}
}

inline void Dfs(int i) {
	if(fa[i] == 1)
		return dp[i] = 1, pos[i] = i, void();
	if(!dp[fa[i]])
		Dfs(fa[i]);
	int j = pos[fa[i]];
	if(qry(rt[j], 1, N, id[i] - mx[i] + mx[j], id[i] - 1))
		dp[i] = dp[j] + 1, pos[i] = i;
	else
		dp[i] = dp[j], pos[i] = pos[j];
}

int main() {
	register int i;
	scanf("%d", &N);
	scanf("%s", S);
	lst = cnt = 1;
	for(i = 0; i < N; ++i)
		extend(i + 1, S[i] - 'a');
	build();
	for(i = 2; i <= cnt; ++i) if(!dp[i]) {
		Dfs(i);
		ans = max(ans, dp[i]);
	}
	printf("%d\n", ans);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 2e5 + 7;

int rt[N << 1], n;

struct Segment_Tree {

#define ls(x) (T[x].ch[0])
#define rs(x) (T[x].ch[1])
#define mid ((l + r) >> 1)

	int cnt;

	struct node { int ch[2], s; } T[N << 7];

	void update(int &bh, int l, int r, int x) {
		if (!bh) bh = ++ cnt;
		++ T[bh].s;
		if (l == r) return;
		if (x <= mid) update(ls(bh), l, mid, x);
		else update(rs(bh), mid + 1, r, x);
	}

	int merge(int x, int y) {
		if (!x || !y) return x + y;
		int t = ++ cnt;
		T[t].s = T[x].s + T[y].s;
		ls(t) = merge(ls(x), ls(y));
		rs(t) = merge(rs(x), rs(y));
		return t;
	}

	bool query(int bh, int l, int r, int L, int R) {
		if (!T[bh].s) return false;
		if (L <= l && r <= R) return T[bh].s;
		if (L <= mid && query(ls(bh), l, mid, L, R)) return 1;
		if (R > mid && query(rs(bh), mid + 1, r, L, R)) return 1;
		return false;
	}

} SGT;

struct Suffix_Automaton {

	int lst, cnt;

	struct node { int trans[26], link, len, pos; } T[N << 1];

	Suffix_Automaton() { lst = cnt = 1; }

	void extend(int pos, int to) {
		int p = lst, now = lst = ++ cnt;
		T[now].len = T[p].len + 1, T[now].pos = pos;
		for(; p && !T[p].trans[to]; p = T[p].link)
			T[p].trans[to] = now;
		if (!p) T[now].link = 1;
		else {
			int x = T[p].trans[to], y;
			if (T[x].len == T[p].len + 1) T[now].link = x;
			else {
				T[y = ++ cnt] = T[x], T[y].len = T[p].len + 1;
				for (; p && T[p].trans[to] == x; p = T[p].link)
					T[p].trans[to] = y;
				T[now].link = T[x].link = y;
			}
		}
		SGT.update(rt[now], 1, n, pos);
	}

	int tp[N], tong[N], f[N], ans;

	void Solve() {
		for (int i = 1; i <= cnt; ++ i) ++ tong[T[i].len];
		for (int i = 1; i <= cnt; ++ i) tong[i] += tong[i - 1];
		for (int i = 1; i <= cnt; ++ i) tp[tong[T[i].len] --] = i;
		for (int i = cnt; i > 1; -- i) rt[T[tp[i]].link] = SGT.merge(rt[T[tp[i]].link], rt[tp[i]]);
		for (int i = 2; i <= cnt; ++ i) {
			int pos = T[tp[i]].pos, fa = T[tp[i]].link;
			f[tp[i]] = 1;
			if (fa ^ 1 && SGT.query(rt[fa], 1, n, pos - T[tp[i]].len + T[fa].len, pos - 1))
				f[tp[i]] = f[fa] + 1;
			ans = max(ans, f[tp[i]]);
		}
		printf("%d\n", ans);
	}

} SAM;

int main() {

	char s[N];

	scanf("%d%s", &n, s + 1);
	for (int i = 1; i <= n; ++ i)
		SAM.extend(i, s[i] - 'a');
	SAM.Solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 2e5 + 7;

int rt[N << 1], n;

struct Segment_Tree {

#define ls(x) (T[x].ch[0])
#define rs(x) (T[x].ch[1])
#define mid ((l + r) >> 1)

	int cnt;

	struct node { int ch[2], s; } T[N << 6];

	void update(int &bh, int l, int r, int x) {
		if (!bh) bh = ++ cnt;
		++ T[bh].s;
		if (l == r) return;
		if (x <= mid) update(ls(bh), l, mid, x);
		else update(rs(bh), mid + 1, r, x);
	}

	int merge(int x, int y) {
		if (!x || !y) return x + y;
		int t = ++ cnt;
		T[t].s = T[x].s + T[y].s;
		ls(t) = merge(ls(x), ls(y));
		rs(t) = merge(rs(x), rs(y));
		return t;
	}

	bool query(int bh, int l, int r, int L, int R) {
		if (!T[bh].s) return false;
		if (L <= l && r <= R) return T[bh].s;
		if (L <= mid && query(ls(bh), l, mid, L, R)) return 1;
		if (R > mid && query(rs(bh), mid + 1, r, L, R)) return 1;
		return false;
	}

} SGT;

struct Suffix_Automaton {

	int lst, cnt;

	struct node { int trans[26], link, len, pos; } T[N << 1];

	Suffix_Automaton() { lst = cnt = 1; }

	void extend(int pos, int to) {
		int p = lst, now = lst = ++ cnt;
		T[now].len = T[p].len + 1, T[now].pos = pos;
		for(; p && !T[p].trans[to]; p = T[p].link)
			T[p].trans[to] = now;
		if (!p) T[now].link = 1;
		else {
			int x = T[p].trans[to], y;
			if (T[x].len == T[p].len + 1) T[now].link = x;
			else {
				T[y = ++ cnt] = T[x], T[y].len = T[p].len + 1;
				for (; p && T[p].trans[to] == x; p = T[p].link)
					T[p].trans[to] = y;
				T[now].link = T[x].link = y;
			}
		}
		SGT.update(rt[now], 1, n, pos);
	}

	int tp[N], tong[N], f[N], ans;

	void Solve() {
		for (int i = 1; i <= cnt; ++ i) ++ tong[T[i].len];
		for (int i = 1; i <= cnt; ++ i) tong[i] += tong[i - 1];
		for (int i = 1; i <= cnt; ++ i) tp[tong[T[i].len] --] = i;
		for (int i = cnt; i > 1; -- i) rt[T[tp[i]].link] = SGT.merge(rt[T[tp[i]].link], rt[tp[i]]);
		for (int i = 2; i <= cnt; ++ i) {
			int pos = T[tp[i]].pos, fa = T[tp[i]].link;
			f[tp[i]] = 1;
			if (fa ^ 1 && SGT.query(rt[fa], 1, n, pos - T[tp[i]].len + T[fa].len, pos - 1))
				f[tp[i]] = f[fa] + 1;
			ans = max(ans, f[tp[i]]);
		}
		printf("%d\n", ans);
	}

} SAM;

int main() {

	char s[N];

	scanf("%d%s", &n, s + 1);
	for (int i = 1; i <= n; ++ i)
		SAM.extend(i, s[i] - 'a');
	SAM.Solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 4e5 + 7;

int rt[N], n;

struct Segment_Tree {

#define ls(x) (T[x].ch[0])
#define rs(x) (T[x].ch[1])
#define mid ((l + r) >> 1)

	int cnt;

	struct node { int ch[2], s; } T[N << 5];

	void update(int &bh, int l, int r, int x) {
		if (!bh) bh = ++ cnt;
		++ T[bh].s;
		if (l == r) return;
		if (x <= mid) update(ls(bh), l, mid, x);
		else update(rs(bh), mid + 1, r, x);
	}

	int merge(int x, int y) {
		if (!x || !y) return x + y;
		int t = ++ cnt;
		T[t].s = T[x].s + T[y].s;
		ls(t) = merge(ls(x), ls(y));
		rs(t) = merge(rs(x), rs(y));
		return t;
	}

	bool query(int bh, int l, int r, int L, int R) {
		if (!T[bh].s) return false;
		if (L <= l && r <= R) return 1;
		if (L <= mid && query(ls(bh), l, mid, L, R)) return 1;
		if (R > mid && query(rs(bh), mid + 1, r, L, R)) return 1;
		return false;
	}

} SGT;

struct Suffix_Automaton {

	int lst, cnt;

	struct node { int trans[26], link, len, pos; } T[N];

	Suffix_Automaton() { lst = cnt = 1; }

	void extend(int pos, int to) {
		int p = lst, now = lst = ++ cnt;
		T[now].len = T[p].len + 1, T[now].pos = pos;
		for(; p && !T[p].trans[to]; p = T[p].link)
			T[p].trans[to] = now;
		if (!p) T[now].link = 1;
		else {
			int x = T[p].trans[to], y;
			if (T[x].len == T[p].len + 1) T[now].link = x;
			else {
				T[y = ++ cnt] = T[x], T[y].len = T[p].len + 1;
				for (; p && T[p].trans[to] == x; p = T[p].link)
					T[p].trans[to] = y;
				T[now].link = T[x].link = y;
			}
		}
		SGT.update(rt[now], 1, n, pos);
	}

	int tp[N], tong[N], f[N], Belong[N], ans;

	void Solve() {
		for (int i = 1; i <= cnt; ++ i) ++ tong[T[i].len];
		for (int i = 1; i <= cnt; ++ i) tong[i] += tong[i - 1];
		for (int i = 1; i <= cnt; ++ i) tp[tong[T[i].len] --] = i;
		for (int i = cnt; i > 1; -- i) rt[T[tp[i]].link] = SGT.merge(rt[T[tp[i]].link], rt[tp[i]]);
		for (int i = 2; i <= cnt; ++ i) {
			int pos = T[tp[i]].pos, fa = T[tp[i]].link;
			if (fa == 1) f[Belong[tp[i]] = tp[i]] = 1;
			else if (SGT.query(rt[Belong[fa]], 1, n, pos - T[tp[i]].len + T[fa].len, pos - 1))
				f[tp[i]] = f[fa] + 1, Belong[tp[i]] = tp[i];
			else f[tp[i]] = f[fa], Belong[tp[i]] = Belong[fa];
			ans = max(ans, f[tp[i]]);
		}
		printf("%d\n", ans);
	}

} SAM;

int main() {

	char s[N];

	scanf("%d%s", &n, s + 1);
	for (int i = 1; i <= n; ++ i)
		SAM.extend(i, s[i] - 'a');
	SAM.Solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 4e5 + 7;

int rt[N], n;

struct Segment_Tree {

#define ls(x) (T[x].ch[0])
#define rs(x) (T[x].ch[1])
#define mid ((l + r) >> 1)

	int cnt;

	struct node { int ch[2], s; } T[N << 5];

	void update(int &bh, int l, int r, int x) {
		if (!bh) bh = ++ cnt;
		++ T[bh].s;
		if (l == r) return;
		if (x <= mid) update(ls(bh), l, mid, x);
		else update(rs(bh), mid + 1, r, x);
	}

	int merge(int x, int y) {
		if (!x || !y) return x + y;
		int t = ++ cnt;
		T[t].s = T[x].s + T[y].s;
		ls(t) = merge(ls(x), ls(y));
		rs(t) = merge(rs(x), rs(y));
		return t;
	}

	bool query(int bh, int l, int r, int L, int R) {
		if (!T[bh].s) return false;
		if (L <= l && r <= R) return 1;
		if (L <= mid && query(ls(bh), l, mid, L, R)) return 1;
		if (R > mid && query(rs(bh), mid + 1, r, L, R)) return 1;
		return false;
	}

} SGT;

struct Suffix_Automaton {

	int lst, cnt;

	struct node { int trans[26], link, len, pos; } T[N];

	Suffix_Automaton() { lst = cnt = 1; }

	void extend(int pos, int to) {
		int p = lst, now = lst = ++ cnt;
		T[now].len = T[p].len + 1, T[now].pos = pos;
		for(; p && !T[p].trans[to]; p = T[p].link)
			T[p].trans[to] = now;
		if (!p) T[now].link = 1;
		else {
			int x = T[p].trans[to], y;
			if (T[x].len == T[p].len + 1) T[now].link = x;
			else {
				T[y = ++ cnt] = T[x], T[y].len = T[p].len + 1;
				for (; p && T[p].trans[to] == x; p = T[p].link)
					T[p].trans[to] = y;
				T[now].link = T[x].link = y;
			}
		}
		SGT.update(rt[now], 1, n, pos);
	}

	int tp[N], tong[N], f[N], Belong[N], ans;

	void Solve() {
		for (int i = 1; i <= cnt; ++ i) ++ tong[T[i].len];
		for (int i = 1; i <= cnt; ++ i) tong[i] += tong[i - 1];
		for (int i = 1; i <= cnt; ++ i) tp[tong[T[i].len] --] = i;
		for (int i = cnt; i > 1; -- i) rt[T[tp[i]].link] = SGT.merge(rt[T[tp[i]].link], rt[tp[i]]);
		for (int i = 2; i <= cnt; ++ i) {
			int pos = T[tp[i]].pos, fa = T[tp[i]].link;
			if (fa == 1) f[Belong[tp[i]] = tp[i]] = 1;
			else if (SGT.query(rt[fa], 1, n, pos - T[tp[i]].len + T[fa].len, pos - 1))
				f[tp[i]] = f[fa] + 1, Belong[tp[i]] = tp[i];
			else f[tp[i]] = f[fa], Belong[tp[i]] = Belong[fa];
			ans = max(ans, f[tp[i]]);
		}
		printf("%d\n", ans);
	}

} SAM;

int main() {

	char s[N];

	scanf("%d%s", &n, s + 1);
	for (int i = 1; i <= n; ++ i)
		SAM.extend(i, s[i] - 'a');
	SAM.Solve();

	return 0;
}