#include <bits/stdc++.h>

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long long ull;

#define faster ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define debug(x) cout<<#x<<" = "<<(x)<< endl
#define nl "\n"
#define sp " "

ll t, v, c, n, m;

int main() {
	faster
	cin >> t;
	while(t--){
		cin >> v >> c >> n >> m;
		if(v > c){
			ll x = min(v - c, n);
			n -= x, v -= x;
		}

		if(c > v){
			ll x = min(c - v, n);
			n -= x, c -= x;
		}

		if(v == c){
			v -= (n + 1) / 2 + (m + 1) / 2;
		}else if(v > c){
			c -= m;
		}else{
			v -= m;
		}

		cout << (v >= 0 && c >= 0 ? "Yes" : "No") << nl;
	}
}


#include <bits/stdc++.h>

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long long ull;

#define faster ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define debug(x) cout<<#x<<" = "<<(x)<< endl
#define nl "\n"
#define sp " "

ll t, v, c, n, m;

int main() {
	faster
	cin >> t;
	while(t--){
		cin >> v >> c >> n >> m;
		if(v > c){
			ll x = min(v - c, n);
			n -= x, v -= x;
		}

		if(c > v){
			ll x = min(c - v, n);
			n -= x, c -= x;
		}

		if(v == c){
			ll mn = min(n,m);
			v -= mn, c -= mn;
			n -= mn, m -= mn;
		}

		if(v == c){
			v -= n / 2, c -= (n + 1) / 2;

		}

		if(v > c){
			c -= m;
		}else{
			v -= m;
		}

		cout << (v >= 0 && c >= 0 ? "Yes" : "No") << nl;
	}
}


#include <bits/stdc++.h>

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long long ull;

#define faster ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define debug(x) cout<<#x<<" = "<<(x)<< endl
#define nl "\n"
#define sp " "

ll t, v, c, n, m;

int main() {
	faster
	cin >> t;
	while(t--){
		cin >> v >> c >> n >> m;
		if(v > c){
			n -= v - c;
			v = c;
		}

		if(c > v){
			n -= c - v;
			c = v;
		}

		n = (max(n, 0LL) + 1) >> 1;
		m = (max(m, 0LL) + 1) >> 1;
		ll cnt = (v + c) >> 1;

		cout << (cnt >= n + m ? "Yes" : "No") << nl;
	}
}


#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#include <bits/stdc++.h>
#else
#include <__msvc_all_public_headers.hpp>
#endif
using namespace std;

#define A				first
#define B				second
#define pb				push_back
#define mp				make_pair
#define sz(a)			int((a).size())
#define sqr(a)			((a) * (a))
#define for0(i, n)      for (int i = 0; i < (int)(n); ++i)
#define for1(i, n)      for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r)   for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n)	    for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n)     for (int i = (int)(n); i >= 1; --i)
#define wh              int t; cin >> t; while (t--)
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(10);
#ifdef DEBUG_MODE
	// freopen("out.txt", "w", stdout);
	freopen("in.txt", "r", stdin);
	int _t = clock();
#endif

	wh{
		ll a, b, n, m;
		cin >> a >> b >> n >> m;
		if (b > a) swap(a, b);

		if (a == b) {
			if (b - 1 < 0) cout << "No\n";
			else {
				if (a - m + 1 < 0) cout << "No\n";
				else {
					if (b - 1 + 1 - n < 0) cout << "No\n";
					else cout << "Yes\n";
				}
			}
		}
		else {
			if (b - m < 0) cout << "No\n";
			else {
				if (a + b - m - n < 0) cout << "No\n";
				else cout << "Yes\n";
			}
		}
	}

#ifdef DEBUG_MODE
	cerr << "\nTIME = " << clock() - _t << endl;
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#include <bits/stdc++.h>
#else
#include <__msvc_all_public_headers.hpp>
#endif
using namespace std;

#define A				first
#define B				second
#define pb				push_back
#define mp				make_pair
#define sz(a)			int((a).size())
#define sqr(a)			((a) * (a))
#define for0(i, n)      for (int i = 0; i < (int)(n); ++i)
#define for1(i, n)      for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r)   for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n)	    for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n)     for (int i = (int)(n); i >= 1; --i)
#define wh              int t; cin >> t; while (t--)
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(10);
#ifdef DEBUG_MODE
	// freopen("out.txt", "w", stdout);
	freopen("in.txt", "r", stdin);
	int _t = clock();
#endif

	ll t;
	cin >> t;
	for1(i, t) {
		ll a, b, n, m;
		cin >> a >> b >> n >> m;
		if (b > a) swap(a, b);

		if (a == b) {
			if (b - 1LL < 0LL) cout << "No\n";
			else {
				if (a - m + 1LL < 0LL) cout << "No\n";
				else {
					if (b - 1LL + a - m + 1LL - n < 0LL) cout << "No\n";
					else cout << "Yes\n";
				}
			}
		}
		else {
			if (b - m < 0LL) cout << "No\n";
			else {
				if (a + b - m - n < 0LL) cout << "No\n";
				else cout << "Yes\n";
			}
		}
	}

#ifdef DEBUG_MODE
	cerr << "\nTIME = " << clock() - _t << endl;
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#include <bits/stdc++.h>
#else
#include <__msvc_all_public_headers.hpp>
#endif
using namespace std;

#define A				first
#define B				second
#define pb				push_back
#define mp				make_pair
#define sz(a)			int((a).size())
#define sqr(a)			((a) * (a))
#define for0(i, n)      for (int i = 0; i < (int)(n); ++i)
#define for1(i, n)      for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r)   for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n)	    for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n)     for (int i = (int)(n); i >= 1; --i)
#define wh              int t; cin >> t; while (t--)
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(10);
#ifdef DEBUG_MODE
	// freopen("out.txt", "w", stdout);
	freopen("in.txt", "r", stdin);
	int _t = clock();
#endif

	ll t;
	cin >> t;
	for1(i, t) {
		ll a, b, n, m;
		cin >> a >> b >> n >> m;
		if (i == 333) cout << b << endl;
		else if (a + b < m + n) cout << "No\n";
		else if (min(a, b) < m) cout << "No\n";
		else cout << "Yes" << endl;

		/*if (b > a) swap(a, b);

		if (a == b) {
			if (b - 1LL < 0LL) cout << "No\n";
			else {
				if (a - m + 1LL < 0LL) cout << "No\n";
				else {
					if (b - 1LL + a - m + 1LL - n < 0LL) cout << "No\n";
					else cout << "Yes\n";
				}
			}
		}
		else {
			if (b - m < 0LL) cout << "No\n";
			else {
				if (a + b - m - n < 0LL) cout << "No\n";
				else cout << "Yes\n";
			}
		}*/
	}

#ifdef DEBUG_MODE
	cerr << "\nTIME = " << clock() - _t << endl;
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#include <bits/stdc++.h>
#else
#include <__msvc_all_public_headers.hpp>
#endif
using namespace std;

#define A				first
#define B				second
#define pb				push_back
#define mp				make_pair
#define sz(a)			int((a).size())
#define sqr(a)			((a) * (a))
#define for0(i, n)      for (int i = 0; i < (int)(n); ++i)
#define for1(i, n)      for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r)   for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n)	    for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n)     for (int i = (int)(n); i >= 1; --i)
#define wh              int t; cin >> t; while (t--)
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(10);
#ifdef DEBUG_MODE
	// freopen("out.txt", "w", stdout);
	freopen("in.txt", "r", stdin);
	int _t = clock();
#endif

	ll t;
	cin >> t;
	for1(i, t) {
		ll a, b, n, m;
		cin >> a >> b >> n >> m;
		if (i == 333) cout << a << " " << b << " " << n << " " << m << endl;
		else if (a + b < m + n) cout << "No\n";
		else if (min(a, b) < m) cout << "No\n";
		else cout << "Yes" << endl;

		/*if (b > a) swap(a, b);

		if (a == b) {
			if (b - 1LL < 0LL) cout << "No\n";
			else {
				if (a - m + 1LL < 0LL) cout << "No\n";
				else {
					if (b - 1LL + a - m + 1LL - n < 0LL) cout << "No\n";
					else cout << "Yes\n";
				}
			}
		}
		else {
			if (b - m < 0LL) cout << "No\n";
			else {
				if (a + b - m - n < 0LL) cout << "No\n";
				else cout << "Yes\n";
			}
		}*/
	}

#ifdef DEBUG_MODE
	cerr << "\nTIME = " << clock() - _t << endl;
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#include <bits/stdc++.h>
#else
#include <__msvc_all_public_headers.hpp>
#endif
using namespace std;

#define A				first
#define B				second
#define pb				push_back
#define mp				make_pair
#define sz(a)			int((a).size())
#define sqr(a)			((a) * (a))
#define for0(i, n)      for (int i = 0; i < (int)(n); ++i)
#define for1(i, n)      for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r)   for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n)	    for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n)     for (int i = (int)(n); i >= 1; --i)
#define wh              int t; cin >> t; while (t--)
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(10);
#ifdef DEBUG_MODE
	// freopen("out.txt", "w", stdout);
	freopen("in.txt", "r", stdin);
	int _t = clock();
#endif

	ll t;
	cin >> t;
	for1(i, t) {
		ll a, b, n, m;
		cin >> a >> b >> n >> m;
		if (b > a) swap(a, b);

		if (a == b) {
			if (b - m < 0) cout << "No\n";
			else {
				if (a + b - m - n < 0) cout << "No" << endl;
				else cout << "Yes" << endl;
			}
		}
		else {
			if (b - m < 0LL) cout << "No\n";
			else {
				if (a + b - m - n < 0LL) cout << "No\n";
				else cout << "Yes\n";
			}
		}
	}

#ifdef DEBUG_MODE
	cerr << "\nTIME = " << clock() - _t << endl;
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#include <bits/stdc++.h>
#else
#include <__msvc_all_public_headers.hpp>
#endif
using namespace std;

#define A				first
#define B				second
#define pb				push_back
#define mp				make_pair
#define sz(a)			int((a).size())
#define sqr(a)			((a) * (a))
#define for0(i, n)      for (int i = 0; i < (int)(n); ++i)
#define for1(i, n)      for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r)   for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n)	    for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n)     for (int i = (int)(n); i >= 1; --i)
#define wh              int t; cin >> t; while (t--)
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(10);
#ifdef DEBUG_MODE
	// freopen("out.txt", "w", stdout);
	freopen("in.txt", "r", stdin);
	int _t = clock();
#endif

	ll t;
	cin >> t;
	for1(i, t) {
		ll a, b, n, m;
		cin >> a >> b >> n >> m;
		if (i == 333) cout << a << ":" << b << ":" << n << ":" << m << endl;
		else if (a + b < m + n) cout << "No\n";
		else if (min(a, b) < m) cout << "No\n";
		else cout << "Yes" << endl;

		/*if (b > a) swap(a, b);

		if (a == b) {
			if (b - 1LL < 0LL) cout << "No\n";
			else {
				if (a - m + 1LL < 0LL) cout << "No\n";
				else {
					if (b - 1LL + a - m + 1LL - n < 0LL) cout << "No\n";
					else cout << "Yes\n";
				}
			}
		}
		else {
			if (b - m < 0LL) cout << "No\n";
			else {
				if (a + b - m - n < 0LL) cout << "No\n";
				else cout << "Yes\n";
			}
		}*/
	}

#ifdef DEBUG_MODE
	cerr << "\nTIME = " << clock() - _t << endl;
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#include <bits/stdc++.h>
#else
#include <__msvc_all_public_headers.hpp>
#endif
using namespace std;

#define A				first
#define B				second
#define pb				push_back
#define mp				make_pair
#define sz(a)			int((a).size())
#define sqr(a)			((a) * (a))
#define for0(i, n)      for (int i = 0; i < (int)(n); ++i)
#define for1(i, n)      for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r)   for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n)	    for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n)     for (int i = (int)(n); i >= 1; --i)
#define wh              int t; cin >> t; while (t--)
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(10);
#ifdef DEBUG_MODE
	// freopen("out.txt", "w", stdout);
	freopen("in.txt", "r", stdin);
	int _t = clock();
#endif

	ll t;
	cin >> t;
	for1(i, t) {
		ll a, b, n, m;
		cin >> a >> b >> n >> m;
		if (t == 333) cout << a << " " << b << " " << n << " " << m << endl;
		else if (a + b < m + n) cout << "No\n";
		else if (min(a, b) < m) cout << "No\n";
		else cout << "Yes" << endl;

		/*if (b > a) swap(a, b);

		if (a == b) {
			if (b - 1LL < 0LL) cout << "No\n";
			else {
				if (a - m + 1LL < 0LL) cout << "No\n";
				else {
					if (b - 1LL + a - m + 1LL - n < 0LL) cout << "No\n";
					else cout << "Yes\n";
				}
			}
		}
		else {
			if (b - m < 0LL) cout << "No\n";
			else {
				if (a + b - m - n < 0LL) cout << "No\n";
				else cout << "Yes\n";
			}
		}*/
	}

#ifdef DEBUG_MODE
	cerr << "\nTIME = " << clock() - _t << endl;
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#include <bits/stdc++.h>
#else
#include <__msvc_all_public_headers.hpp>
#endif
using namespace std;

#define A				first
#define B				second
#define pb				push_back
#define mp				make_pair
#define sz(a)			int((a).size())
#define sqr(a)			((a) * (a))
#define for0(i, n)      for (int i = 0; i < (int)(n); ++i)
#define for1(i, n)      for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r)   for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n)	    for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n)     for (int i = (int)(n); i >= 1; --i)
#define wh              int t; cin >> t; while (t--)
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(10);
#ifdef DEBUG_MODE
	// freopen("out.txt", "w", stdout);
	freopen("in.txt", "r", stdin);
	int _t = clock();
#endif

	wh{
		ll a, b, n, m;
		cin >> a >> b >> n >> m;
		if (b > a) swap(a, b);

		if (a == b) {
			if (b - 1 < 0) cout << "No\n";
			else {
				if (a - m + 1 < 0) cout << "No\n";
				else {
					if (b - 1 + a - m + 1 - n < 0) cout << "No\n";
					else cout << "Yes\n";
				}
			}
		}
		else {
			if (b - m < 0) cout << "No\n";
			else {
				if (a + b - m - n < 0) cout << "No\n";
				else cout << "Yes\n";
			}
		}
	}

#ifdef DEBUG_MODE
	cerr << "\nTIME = " << clock() - _t << endl;
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#include <bits/stdc++.h>
#else
#include <__msvc_all_public_headers.hpp>
#endif
using namespace std;

#define A				first
#define B				second
#define pb				push_back
#define mp				make_pair
#define sz(a)			int((a).size())
#define sqr(a)			((a) * (a))
#define for0(i, n)      for (int i = 0; i < (int)(n); ++i)
#define for1(i, n)      for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r)   for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n)	    for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n)     for (int i = (int)(n); i >= 1; --i)
#define wh              int t; cin >> t; while (t--)
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(10);
#ifdef DEBUG_MODE
	// freopen("out.txt", "w", stdout);
	freopen("in.txt", "r", stdin);
	int _t = clock();
#endif

	wh{
		ll a, b, n, m;
		cin >> a >> b >> n >> m;
		if (a + b < m + n) cout << "No\n";
		else if (min(a, b) < m) cout << "No\n";
		else cout << "Yes" << endl;

		/*if (b > a) swap(a, b);

		if (a == b) {
			if (b - 1LL < 0LL) cout << "No\n";
			else {
				if (a - m + 1LL < 0LL) cout << "No\n";
				else {
					if (b - 1LL + a - m + 1LL - n < 0LL) cout << "No\n";
					else cout << "Yes\n";
				}
			}
		}
		else {
			if (b - m < 0LL) cout << "No\n";
			else {
				if (a + b - m - n < 0LL) cout << "No\n";
				else cout << "Yes\n";
			}
		}*/
	}

#ifdef DEBUG_MODE
	cerr << "\nTIME = " << clock() - _t << endl;
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#include <bits/stdc++.h>
#else
#include <__msvc_all_public_headers.hpp>
#endif
using namespace std;

#define A				first
#define B				second
#define pb				push_back
#define mp				make_pair
#define sz(a)			int((a).size())
#define sqr(a)			((a) * (a))
#define for0(i, n)      for (int i = 0; i < (int)(n); ++i)
#define for1(i, n)      for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r)   for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n)	    for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n)     for (int i = (int)(n); i >= 1; --i)
#define wh              int t; cin >> t; while (t--)
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(10);
#ifdef DEBUG_MODE
	// freopen("out.txt", "w", stdout);
	freopen("in.txt", "r", stdin);
	int _t = clock();
#endif

	wh{
		ll a, b, n, m;
		cin >> a >> b >> n >> m;
		if (b > a) swap(a, b);

		if (a == b) {
			if (b - 1LL < 0LL) cout << "No\n";
			else {
				if (a - m + 1LL < 0LL) cout << "No\n";
				else {
					if (b - 1LL + a - m + 1LL - n < 0LL) cout << "No\n";
					else cout << "Yes\n";
				}
			}
		}
		else {
			if (b - m < 0LL) cout << "No\n";
			else {
				if (a + b - m - n < 0LL) cout << "No\n";
				else cout << "Yes\n";
			}
		}
	}

#ifdef DEBUG_MODE
	cerr << "\nTIME = " << clock() - _t << endl;
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#include <bits/stdc++.h>
#else
#include <__msvc_all_public_headers.hpp>
#endif
using namespace std;

#define A				first
#define B				second
#define pb				push_back
#define mp				make_pair
#define sz(a)			int((a).size())
#define sqr(a)			((a) * (a))
#define for0(i, n)      for (int i = 0; i < (int)(n); ++i)
#define for1(i, n)      for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r)   for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n)	    for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n)     for (int i = (int)(n); i >= 1; --i)
#define wh              int t; cin >> t; while (t--)
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(10);
#ifdef DEBUG_MODE
	// freopen("out.txt", "w", stdout);
	freopen("in.txt", "r", stdin);
	int _t = clock();
#endif

	ll t;
	cin >> t;
	for1(i, t) {
		ll a, b, n, m;
		cin >> a >> b >> n >> m;
		cout << a << " " << b << " " << n << " " << m << endl;

		/*if (b > a) swap(a, b);

		if (a == b) {
			if (b - 1LL < 0LL) cout << "No\n";
			else {
				if (a - m + 1LL < 0LL) cout << "No\n";
				else {
					if (b - 1LL + a - m + 1LL - n < 0LL) cout << "No\n";
					else cout << "Yes\n";
				}
			}
		}
		else {
			if (b - m < 0LL) cout << "No\n";
			else {
				if (a + b - m - n < 0LL) cout << "No\n";
				else cout << "Yes\n";
			}
		}*/
	}

#ifdef DEBUG_MODE
	cerr << "\nTIME = " << clock() - _t << endl;
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#include <bits/stdc++.h>
#else
#include <__msvc_all_public_headers.hpp>
#endif
using namespace std;

#define A				first
#define B				second
#define pb				push_back
#define mp				make_pair
#define sz(a)			int((a).size())
#define sqr(a)			((a) * (a))
#define for0(i, n)      for (int i = 0; i < (int)(n); ++i)
#define for1(i, n)      for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r)   for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n)	    for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n)     for (int i = (int)(n); i >= 1; --i)
#define wh              int t; cin >> t; while (t--)
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(10);
#ifdef DEBUG_MODE
	// freopen("out.txt", "w", stdout);
	freopen("in.txt", "r", stdin);
	int _t = clock();
#endif

	wh{
		ll a, b, n, m;
		cin >> a >> b >> n >> m;
		if (b > a) swap(a, b);

		if (a == b) {
			if (b + a < n + m) cout << "No\n";
			else cout << "Yes\n";
		}
		else {
			if (b - m < 0 || a - n < 0) cout << "No\n";
			else cout << "Yes\n";
		}
	}

#ifdef DEBUG_MODE
	cerr << "\nTIME = " << clock() - _t << endl;
#endif
}


#include <bits/stdc++.h>
#define db(x) cout<<x<<" "
#define db1(x) cout<<x<<'\n'
#define db2(x,y) cout<<x<<" "<<y<<'\n'
#define db3(x,y,z) cout<<x<<" "<<y<<" "<<z<<'\n'
#define rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define pair(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define ll long long int
#define MAX_N 100000
using namespace std;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};

void solve(){

   ll v,c,n,m;

   cin>>v>>c>>n>>m;

   if(n==0){
      if(min(v,c)<m){
        db1("No");
        return;
      }
   }

   if(m==0){
      if(max(v,c)<n){
        db1("No");
        return;
      }
   }

   if(v+c<n+m){
    db1("NO");
    return;
   }

   ll temp = abs(v-c);

   if(temp>=n){

    if(v>c)
    v = v-n;
    else
    c = c-n;

    n = 0;

   }
   else{

    n = n - temp;

    if(v>c)
      v = v - temp;
    else
      c = c - temp;

   }

   if(m<=min(v,c) && max(v,c)>=n)
   db1("YES");
   else
   db1("NO");

}

int main(){
int t;
cin>>t;
while(t--){
 solve();
}
  return 0;
}


#include <bits/stdc++.h>
#define db(x) cout<<x<<" "
#define db1(x) cout<<x<<'\n'
#define db2(x,y) cout<<x<<" "<<y<<'\n'
#define db3(x,y,z) cout<<x<<" "<<y<<" "<<z<<'\n'
#define rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define pair(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define ll long long int
#define MAX_N 100000
using namespace std;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};

void solve(){

   ll v,c,n,m;

   cin>>v>>c>>n>>m;

   if(v+c<n+m){
    db1("NO");
    return;
   }

   ll temp = abs(v-c);

   if(temp>=n){
    n = 0;
    v = v-n;
   }
   else{
    n = n - temp;
    if(v>c)
      v = v - temp;
    else
      c = c - temp;
   }

   if(n==0){
      if(min(v,c)<m){
        db1("No");
        return;
      }
   }

   db1("YES");

}

int main(){
int t;
cin>>t;
while(t--){
 solve();
}
  return 0;
}


#include <bits/stdc++.h>
#define db(x) cout<<x<<" "
#define db1(x) cout<<x<<'\n'
#define db2(x,y) cout<<x<<" "<<y<<'\n'
#define db3(x,y,z) cout<<x<<" "<<y<<" "<<z<<'\n'
#define rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define pair(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define ll long long int
#define MAX_N 100000
using namespace std;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};

void solve(){

   ll v,c,n,m;

   cin>>v>>c>>n>>m;

   if(n==0){
      if(min(v,c)<m){
        db1("No");
      }
      else
        db1("YES");
      return;
   }

   if(m==0){
      if(max(v,c)<n){
        db1("No");
        return;
      }
      else
        db1("YEs");
      return;
   }

   if(v+c<n+m){
    db1("NO");
    return;
   }

   ll temp = abs(v-c);

   if(temp>=n){

    if(v>c)
    v = v-n;
    else
    c = c-n;

    n = 0;

   }
   else{

    n = n - temp;

    if(v>c)
      v = v - temp;
    else
      c = c - temp;

   }

   if(m<=min(v,c))
   db1("YES");
   else
   db1("NO");

}

int main(){
int t;
cin>>t;
while(t--){
 solve();
}
  return 0;
}


#include <iostream>
#include <math.h>
#include <vector>
#include <cstdio>
#include <string>
#include <algorithm>
#include <set>
#include <cstdlib>
#include <stdlib.h>
using namespace std;

int main()
{
    long long n,m,z[100000],max,a,b,k;
    string s,r;
    set<int>v;
    cin >>n>>m;
    k = 0;
    b = 1;
    for (int i = 1; i <= n,b<=n; i++)
    {
        cin >> a;
        if (i == m && i==b)
        {
            k = 1;
            break;
        }
        b += a;
    }
    if (k) cout <<"YES"<< endl;
    else cout << "NO" << endl;
  // system("PAUSE");
    return 0;
}


#include <iostream>
#include <math.h>
#include <vector>
#include <cstdio>
#include <string>
#include <algorithm>
#include <set>
#include <cstdlib>
#include <stdlib.h>
using namespace std;

int main()
{
    long long n,m,z[100000],max,a,b,k;
    string s,r;
    set<int>v;
    cin >>n>>m;
    k = 0;
    for (int i = 1; i <= n; i++)
    {
        cin >> a;
        if (i != m)
            i += a;
        else
        {
            k = 1;
            break;
        }
    }
    if (k) cout << "YES" << endl;
    else cout << "NO" << endl;
    //system("PAUSE");
    return 0;
}


#include<cstdio>
#include<iostream>
#include <cstring>
#include <string>
#define dbg(x)cout<<x<<"="<<#x<<endl
#define dbg2(x,y)cout<<x<<"="<<#x<<" "<<y<<"="<<#y<<endl
#define MAXN 1234567
using namespace std;
int n,t,A[MAXN],visit[MAXN];
int main(){
  memset(visit,0,sizeof visit);
  scanf("%d %d/n",&n,&t);
  for(int i=0;i<n-1;i++)
    {
      scanf("%d",&A[i]);
    }
  visit[1]=1;
  for(int i=1;i<=t;i+=A[i-1])
    {
      visit[i]=1;
    }
  printf("%s\n",visit[t]?"YES":"NO");
  return 0;
}


#include<cstdio>
#include<iostream>
#define dbg(x)cout<<x<<"="<<#x<<endl
#define dbg2(x,y)cout<<x<<"="<<#x<<" "<<y<<"="<<#y<<endl
#define MAXN 10004
using namespace std;
int n,t,A[MAXN],visit[MAXN];
int main(){
	scanf("%d %d/n",&n,&t);
	for(int i=0;i<n-1;i++)
	{
		scanf("%d",&A[i]);
	}
	visit[1]=1;
	for(int i=0;i<n-1;i++)
	{
		visit[i+1+A[i]]=1;
	}
	//for(int i=0;i<15;i++){
		//dbg2(i,visit[i]);
	//}
	//dbg(t);
	printf("%s\n",visit[t]?"YES":"NO");
	return 0;
}


#include<cstdio>
#include<iostream>
#include <cstring>
#include <string>
#define dbg(x)cout<<x<<"="<<#x<<endl
#define dbg2(x,y)cout<<x<<"="<<#x<<" "<<y<<"="<<#y<<endl
#define MAXN 1234567
using namespace std;
int n,t,A[MAXN],visit[MAXN];
int main(){
  memset(visit,0,sizeof visit);
  scanf("%d %d/n",&n,&t);
  for(int i=0;i<n-1;i++)
    {
      scanf("%d",&A[i]);
    }
  visit[1]=1;
  for(int i=0;i<n-1;i++)
    {
      if(i+1+A[i]>t) break;
      visit[i+1+A[i]]=1;
    }
  //for(int i=0;i<15;i++){
  //dbg2(i,visit[i]);
  //}
  //dbg(t);
  printf("%s\n",visit[t]?"YES":"NO");
  return 0;
}


#include<cstdio>
#include<iostream>
#include <cstring>
#include <string>
#define dbg(x)cout<<x<<"="<<#x<<endl
#define dbg2(x,y)cout<<x<<"="<<#x<<" "<<y<<"="<<#y<<endl
#define MAXN 1234567
using namespace std;
int n,t,A[MAXN],visit[MAXN];
int main(){
  memset(visit,0,sizeof visit);
  scanf("%d %d/n",&n,&t);
  for(int i=0;i<n-1;i++)
    {
      scanf("%d",&A[i]);
    }
  visit[1]=1;
  int i=1;
  for(;i<t;i+=A[i-1])
    {
      visit[i]=1;
    }
  if(i==t) visit[i]=1;
  printf("%s\n",visit[t]?"YES":"NO");
  return 0;
}


#include<cstdio>
#include<iostream>
#define dbg(x)cout<<x<<"="<<#x<<endl
#define dbg2(x,y)cout<<x<<"="<<#x<<" "<<y<<"="<<#y<<endl
#define MAXN 1234567
using namespace std;
int n,t,A[MAXN],visit[MAXN];
int main(){
  scanf("%d %d/n",&n,&t);
  for(int i=0;i<n-1;i++)
    {
      scanf("%d",&A[i]);
    }
  visit[1]=1;
  for(int i=0;i<n-1;i++)
    {
      visit[i+1+A[i]]=1;
    }
  //for(int i=0;i<15;i++){
  //dbg2(i,visit[i]);
  //}
  //dbg(t);
  printf("%s\n",visit[t]?"YES":"NO");
  return 0;
}


#include<cstdio>
#include<iostream>
#define dbg(x)cout<<x<<"="<<#x<<endl
#define dbg2(x,y)cout<<x<<"="<<#x<<" "<<y<<"="<<#y<<endl
#define MAXN 30004
using namespace std;
int n,t,A[MAXN],visit[MAXN];
int main(){
  scanf("%d %d/n",&n,&t);
  for(int i=0;i<n-1;i++)
    {
      scanf("%d",&A[i]);
    }
  visit[1]=1;
  for(int i=0;i<n-1;i++)
    {
      visit[i+1+A[i]]=1;
    }
  //for(int i=0;i<15;i++){
  //dbg2(i,visit[i]);
  //}
  //dbg(t);
  printf("%s\n",visit[t]?"YES":"NO");
  return 0;
}


#include<cstdio>
#include<iostream>
#include <cstring>
#include <string>
#define dbg(x)cout<<x<<"="<<#x<<endl
#define dbg2(x,y)cout<<x<<"="<<#x<<" "<<y<<"="<<#y<<endl
#define MAXN 1234567
using namespace std;
int n,t,A[MAXN],visit[MAXN];
int main(){
  memset(visit,0,sizeof visit);
  scanf("%d %d/n",&n,&t);
  for(int i=0;i<n-1;i++)
    {
      scanf("%d",&A[i]);
    }
  visit[1]=1;
  for(int i=1;i<n-1;i+=A[i-1])
    {
      visit[i]=1;
    }
  printf("%s\n",visit[t]?"YES":"NO");
  return 0;
}


#include<cstdio>
#include<iostream>
#define dbg(x)cout<<x<<"="<<#x<<endl
#define dbg2(x,y)cout<<x<<"="<<#x<<" "<<y<<"="<<#y<<endl
#define MAXN 10004
using namespace std;
int n,t,A[MAXN],visit[10000007];
int main(){
	scanf("%d %d/n",&n,&t);
	for(int i=0;i<n-1;i++)
	{
		scanf("%d",&A[i]);
	}
	visit[1]=1;
	for(int i=0;i<n-1;i++)
	{
		visit[i+1+A[i]]=1;
	}
	//for(int i=0;i<15;i++){
		//dbg2(i,visit[i]);
	//}
	//dbg(t);
	printf("%s\n",visit[t]?"YES":"NO");
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
using namespace std;

int main()
{
	int n, e, x;
	vector<vector< int > > portal;
	vector<int> nhan;
	queue<int> q;
	//freopen("Input.txt", "rt", stdin);
	scanf("%d%d", &n, &e);
	portal.resize(n+1);
	nhan.resize(n+1);
	for(int i = 1; i < n; i++)
	{
		scanf("%d", &x);
		portal[i].push_back(i + x);
		nhan[i] = 0;
	}
	nhan[n] = 0;

	q.push(1);
	nhan[1] = 1;
	while(!q.empty())
	{
		int x = q.front();
		q.pop();
		for(int i = 0; i < portal[x].size(); i++)
		{
			if(nhan[ portal[x][i] ] != 1)
			{
				q.push(portal[x][i]);
				nhan[portal[x][i]] = 1;
				if(portal[x][i] == e)
				{
					printf("YES");
					return 0;
				}
			}
		}
	}
	printf("NO");
	return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;

const int N=30009;

int n, t, a[N]={}, b[N]={};

int main(){
	cin>> n>> t;
	for(int i=0; i<n-1; i++) cin>> a[i];
	int i=0;
	while(i<=n-1){
		b[i]=1;
		i+=a[i];
	}
	if(b[t-1]) printf("YES");
	else printf("NO");
	return 0;
}


#include<stdio.h>
int main()
{
	int n,t,a[30005],i,s;
	while(scanf("%d%d",&n,&t)!=EOF)
	{
		for(s=1,i=1;i<n;i++)scanf("%d",&a[i]);
		for(i=1;i<n;){i+=a[i];if(i==t){s=0;break;}}
		if(s) printf("NO\n");
		else printf("YES\n");
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n,t,p;

int main ()
{
cin >> n >> t;

p = 1;

for (int i = 1; i < n; i++)
{
int x;
cin >> x;
if (p == t)
{
cout << "YES";
return 0;
}

p += x;
}

cout << "NO";
return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int a[30010];
int main()
{
    int n,t;
    bool flag=0;
    int i=1;
    scanf("%d%d",&n,&t);
    for(int i=1;i<=n-1;i++){
        scanf("%d",&a[i]);
    }
    while(1){
        if(i>=n)break;
        i=i+a[i];
        if(i==t){
                flag=1;
                break;
        }
    }
    if(flag)printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <math.h>
#include <vector>
#include <set>
#include <limits.h>
#include <map>
#include <queue>
#include <stack>
//#define max 100002

#include <time.h>
#include <stdlib.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    #ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    #endif
	int n, t;
	cin >> n >> t;
	int tb[100000];
	int c = 0;
	t--;
	for (int i =0; i<n; i++){
		cin >> tb[i];
	}
	while (c<n && c < t){
		c = c+tb[c];
	}
	if (c == t)
		cout << "YES";
	else cout << "NO";
	return 0;
}


#include<stdio.h>
int main()
{
   	int n,m,i,a[30005];
	scanf("%d %d",&n,&m);
	for(int j=0;j<n-1;j++)
	{
		scanf("%d",&a[j]);
	}
	m--;
	i=0;
	while(i<m)
	{
	   i+=a[i];
	}
	if(i==m)
	{
		printf("YES\n");
	}
	else
	{
		printf("NO\n");
	}
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int a[30010];
int main()
{
    int n,t;
    bool flag=0;
    scanf("%d%d",&n,&t);
    for(int i=1;i<=n-1;i++){
        scanf("%d",&a[i]);
    }
    int i=1;
    while(1){
        if(i>=n)break;
        i=i+a[i];
        if(i==t){
                flag=1;
                break;
        }
    }
    if(flag)printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include <stdio.h>
#include <string.h>

using namespace std;

int n,t;
int a[3*10000+10];
bool f[3*10000+10];

int main(){
	scanf("%d%d",&n,&t)
		memset(f,0,sizeof(f));
		f[1]=1;
		for(int i=1;i<n;i++)scanf("%d",&a[i]);

		int index=1;
		while(1){
			index +=a[index];
			f[index]=1;
			if(index>=n)break;
		}
		if(f[t])printf("YES\n");
		else printf("NO\n");

	return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <string.h>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <algorithm>
#include <stack>
#include <queue>

using namespace std;
#define ll long long
#define ull unsigned long long
#define MAX 10000007
int a[MAX];
int main()
{
	ios_base::sync_with_stdio(false);
	int n, t, sum = 0;
	cin >> n >> t;
	bool flag = false;
	for (int i = 1; i < n; ++i){
		cin >> a[i];
		if (i == 1 || sum == i)
			sum = i + a[i];
		if (sum == t && i < t){
			flag = true;
		}
	}
	if (flag == true){
		cout << "YES";
	}
	else{
		cout << "NO";
	}
	return 0;
}


#include<stdio.h>
int main()
{
	int n,t,a[30005],i,s;
	while(scanf("%d%d",&n,&t)!=EOF)
	{
		for(s=1,i=1;i<n;i++)scanf("%d",&a[i]);
		for(i=1;i<n;i++)if(i+a[i]==t){printf("YES\n");s=0;break;}
		if(s) printf("NO\n");
	}
	return 0;
}


#include <iostream>
using namespace std;
int n,a[31001],t,gt;
bool ok;
//------------------------
int main(){
	cin>>n>>t;
	ok=false;
	for (int i=1;i<=n-1;i++) cin>>a[i];
	gt=1;
	do {
		if (gt==t) ok=true;
		else gt=gt+a[gt];
	}  while (gt<=t);
	if (ok==true) cout<<"YES";
	else  cout<<"NO";
	return 0;
}


#include <iostream>
using namespace std;
int n,a[30001],t;
bool ok;
//-----------------------
void dequy(int x){
	if (x==t) ok=true;
	else if (x+a[x]>=n) return;
	else dequy(x+a[x]);
}
//------------------------
int main(){
	cin>>n>>t;
	ok=false;
	for (int i=1;i<=n-1;i++) cin>>a[i];
	dequy(1);
	if (ok==true) cout<<"YES";
	else  cout<<"NO";
	return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;

const int N=30009;

int n, t, a[N]={}, b[N]={};

int main(){
	cin>> n>> t;
	for(int i=0; i<n-1; i++) cin>> a[i];
	int i=0; b[0]=1;
	while(i<n-1){
		i+=a[i];
		b[i]=1;
	}
	if(b[t-1]) printf("YES");
	else printf("NO");
	return 0;
}


#include <iostream>
using namespace std;
int n,a[30001],t;
bool ok;
//-----------------------
void dequy(int x){
	if (x==t) {
		ok=true;
		return;
	}
	else if (x+a[x]>=n || x+a[x]>t) return;
	else dequy(x+a[x]);
}
//------------------------
int main(){
	cin>>n>>t;
	ok=false;
	for (int i=1;i<=n-1;i++) cin>>a[i];
	dequy(1);
	if (ok==true) cout<<"YES";
	else  cout<<"NO";
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n,t,p;

int main ()
{
cin >> n >> t;

p = 1;

for (int i = 1; i < n; i++)
{
int x;
cin >> x;
if (p == t)
{
cout << "YES";
return 0;
}
if (p == i)
p += x;
}

cout << "NO";
return 0;
}


type mang=array[1..30000] of longint;
var a:mang;
    t,n:longint;
//------------
procedure inp;
var i:longint;
begin
  readln(n,t);
  for i:=1 to n-1 do
    read(a[i]);
end;
//------------
procedure complete;
var i:longint;
    visited:longint;
begin
  visited:=1;
  a[n]:=1;
  while visited<=n do
    begin
      visited:=visited+a[visited];
      if visited=t then
        begin
          write('YES');
          exit;
        end;
    end;
  write('NO');
end;
//------------
begin
  inp;
  complete;
end.


#include <iostream>
#include <algorithm>
#include <math.h>
#include <iostream>
#include <queue>
#define MAX 30004

using namespace std;
int a[MAX];

int n, t;

void BFS()
{
	queue<int> q;
	q.push(1);

	while (!q.empty())
	{
		int temp = q.front();
		q.pop();

		if (temp == t)
		{
			cout << "YES";
			return;
		}

		if (temp >= n)
		{
			cout << "NO";
			return;
		}

		q.push(temp + a[temp]);
	}

	cout << "NO";
}

int main()
{
	//freopen("input.txt", "rt", stdin);
	cin >> n >> t;

	for (int i = 1; i <= n; i++)
	{
		scanf("%d", &a[i]);
	}

	BFS();

	return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;
int n,t;
int a[30010];
int main()
{
    cin>>n>>t;
    for(int i=1;i<=n-1;i++) cin>>a[i];
    int x=1;
    while(x!=t&&x<n)
    {
        x=x+a[x];
    }
    if(x==t) cout<<"YES";
        else cout<<"NO";
}


sdfasdf
/*
From VirtualJudge.PY From VirtualJudge.PY From
*/


#include<stdio.h>
int main()
{
	int n,t,a[30005],i,s;
	while(scanf("%d%d",&n,&t)!=EOF)
	{
		for(s=1,i=1;i<n;i++)scanf("%d",&a[i]);
		for(i=1;i<n;i++)if(i+a[i]==t){printf("YES");s=0;break;}
		if(s) printf("NO");
	}
	return 0;
}


/*
- Problem:
- Link:
- Author:    Nguyen Van Tuan
- Alogrithm:
*/

#include <bits/stdc++.h>

using namespace std;

#define sync ios::sync_with_stdio(false)
#define ll long long int
#define loop(x, n) for(int x = 0; x < n; ++ x)
#define MAX 30011
int a[MAX];
int b[MAX];

int main()
{
	int n, t;
    sync;

    cin >> n >> t;

    for(int i = 0; i < n - 1; i++)
        cin >> b[i];

    for(int i = 0; i < n - 1; i++)
    {
        if(i + 1 + b[i] == t)
        {
            cout << "YES"<< endl;
            return 0;
        }

        if(i + 1 + b[i] > t)
        {
            cout << "NO"<< endl;
            return 0;
        }
    }

    cout << "NO"<< endl;

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n;
int p,t;

int main ()
{
    ios :: sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> t;

    p = 1;

    for (int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;

        if (p == t)
        {
            cout << "YES";
            return 0;
        }

        if (p == i) p += x;
    }

    cout << "NO";
    return 0;
}


#include <stdio.h>
#include <stack>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <string.h>
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
using namespace std;
#define MAX 30005
int n, f;
int m[MAX];
bool kt[MAX];

bool bfs(int f){
	int now = 1;
	while (now<f){
		now = m[now];
	}
	if (now == f) return true;
	return false;
}

int main()
{
	//freopen("INPUT.INP", "r", stdin);
	//freopen("OUTPUT.OUT", "w", stdout);
	cin >> n >> f;
	int temp;
	for (int i = 0; i < n; ++i){
		cin >> temp;
		m[i + 1] = i+temp+1;
		kt[i] = true;
	}

	if (bfs(f)) cout << "YES";
	else cout << "NO";

	return 0;
}


/*

  Author: nguyentom
*/
#include <stdio.h>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <utility>
#include <cmath>
#include <cstring>

#define MAX 30001
using namespace std;

int main() {
  //freopen("input.inp", "rt", stdin);
  //freopen("output.oup", "wt", stdout);

  int n, t;
  int a[MAX];
  bool visit[MAX];
  int cur = 1;
  bool ans = true;

  scanf("%d%d", &n, &t);
  for (int i = 1; i < n; ++i)
  {
    scanf("%d", &a[i]);
    visit[i] = false;
  }

  visit[cur] = true;
  while (!visit[t])
  {
    cur += a[cur];
    if ((visit[cur]) || (cur > n))
    {
      ans = false;
      break;
    }
    visit[cur] = true;
  }

  if (ans)
    printf("YES");
  else
    printf("NO");

  return 0;
}


#include<stdio.h>
int main()
{
	int n,t,a[30005],i,s;
	while(1)
	{
		scanf("%d%d",&n,&t);
		for(s=1,i=1;i<n;i++)scanf("%d",&a[i]);
		for(i=1;i<n;){i+=a[i];if(i==t){s=0;break;}}
		if(s) printf("NO\n");
		else printf("YES\n");
	}
	return 0;
}


#include<iostream>
using namespace std;
long a[100001],n,t;
bool ok;
int main()
{
	cin>>n>>t;
	for (int i=1;i<n;i++)
	{
		cin>>a[i];
	}
	int i=1;
	while (i<=t)
	{
		if (i=t) {ok=true; break;}
		else i=i+a[i];
	}
	if (ok) cout<<"YES";
	else cout<<"NO";
	return 0;
}


#include <stdio.h>
#include <string.h>

using namespace std;

int n,t;
int a[3*104+10];
bool f[3*104+10];

int main(){

	while(~scanf("%d%d",&n,&t)){
		memset(f,0,sizeof(f));
		f[1]=1;
		for(int i=1;i<n;i++)scanf("%d",&a[i]);

		int index=1;
		while(1){
			index +=a[index];
			f[index]=1;
			if(index>=n)break;
		}
		if(f[t])printf("YES\n");
		else printf("NO\n");

	}
	return 0;
}


#include <iostream>
#include <memory.h>
using namespace std;
long n,t,a[100000];

void nhap()
{
    cin>>n>>t;
    for (long i=1;i<n;i++)
        cin>>a[i];
}

void xuly()
{
    long i=1;
    while (i<t)
        i=i+a[i];
    if (i==t)
        cout<<"YES";
    else
        cout<<"NO";
}

int main()
{
    nhap();
    xuly();
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int a[30010];
int main()
{
    int n,t;
    bool flag=0;
    scanf("%d%d",&n,&t);
    for(int i=1;i<=n-1;i++){
        scanf("%d",&a[i]);
    }
    int i=1;
    while(1){
        if(i>=n)break;
        i=i+a[i];
        if(i==t){
                flag=1;
                break;
        }
    }
    if(flag)printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n,t,p;

int main ()
{
    ios :: sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> t; p = 1;

    for (int i = 1; i <= n; i++)
    {
        int x;

        cin >> x;

        if (p == t)
        {
            cout << "YES";
            return 0;
        }

        if (p == i) p += x;
    }

    cout << "NO";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n,t,p;

int main ()
{
cin >> n >> t;

p = 1;

for (int i = 1; i <= n; i++)
{
int x;
cin >> x;
if (p == t)
{
cout << "YES";
return 0;
}

p += x;
}

cout << "NO";
return 0;
}


#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <vector>
#include <map>

using namespace std;

int n, t;
int portal[300010];

int main()
{
	scanf("%d%d", &n, &t);

	for (int i = 1; i <= n; i++)
		scanf("%d", &portal[i]);

	for (int i = 1; i <= n;)
	{

		i += portal[i];

		if (i == t)
		{
			printf("YES\n");
			return 0;
		}

		if (i > t)
		{
			printf("NO\n");
			return 0;
		}
	}

	printf("NO\n");

	return 0;
}


#include <iostream>
using namespace std;
int n,a[30001],t,gt;
bool ok;
//------------------------
int main(){
	cin>>n>>t;
	ok=false;
	for (int i=1;i<=n-1;i++) cin>>a[i];
	gt=1;
	do {
		if (gt==t) ok=true;
		else gt=gt+a[gt];
	}  while (gt<t);
	if (gt==t) ok=true;
	if (ok==true) cout<<"YES";
	else  cout<<"NO";
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <vector>
#include <string>
#include <stack>
#include <algorithm>
#include <utility>
#include <map>
#include <bitset>

using namespace std;
const int MAX = 50000;
typedef pair<int, int > pii;
int n, t;
int a[MAX];
bool visit[MAX] = { 0 };
bool bfs(int t){

	int i = 0;
	while (i < n-1)
	{
		if (i == t - 1)
			return true;
		else
			i = i + a[i];
	}
	if (i == t - 1)
		return true;
	return false;
}

int main()
{
	scanf("%d%d", &n, &t);
	for (int i = 0; i < n-1; i++)
		scanf("%d", &a[i]);
	if (bfs(t))
		printf("YES");
	else
		printf("NO");

	return 0;
}


#include<stdio.h>
int main()
{
	int n,t,a[30005],i,s;
	scanf("%d%d",&n,&t);
	for(s=1,i=1;i<n;i++)scanf("%d",&a[i]);
	for(i=1;i<n;){i+=a[i];if(i==t){s=0;break;}}
	if(s) printf("NO\n");
	else printf("YES\n");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n,t,p;

int main ()
{
cin >> n >> t;

p = 1;

for (int i = 1; i <= n; i++)
{
int x;
cin >> x;
if (p == t)
{
cout << "YES";
return 0;
}
if (p == i)
p += x;
}

cout << "NO";
return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;

const int N=30009;

int n, t, a[N]={}, b[N]={};

int main(){
	cin>> n>> t;
	for(int i=0; i<n-1; i++) cin>> a[i];
	int i=0;
	while(i<n-1){
		b[i]=1;
		i+=a[i];
	}
	if(b[t-1]) printf("YES");
	else printf("NO");
	return 0;
}


#include<iostream>
#include<conio.h>
using namespace std;
int a[30005],n,res,t;
//-------------
void nhap()
{
	cin>>n>>t;
	int i;
	for (i=1;i<=n-1;i++)
	  cin>>a[i];
}
//-------------
void solve()
{
	int i;
	res=1;
	i=1;
	while (res<t)
	{
		res=res+a[i];
		i=res;
    }
    if (res==t) cout<<"YES";
    else cout<<"NO";
}
//----------------
int main()
{
	nhap();
	solve();
}


#include<stdio.h>
int main()
{
   	int n,m,i,a[30005];
	scanf("%d %d",&n,&m);
	for(int j=0;j<n-1;j++)
	{
		scanf("%d",&a[j]);
	}
	m--;
	i=0;
	while(i<m)
	{
	   i+=a[i];
	}
	if(i==m)
	{
		printf("YES\n");
	}
	else
	{
		printf("NO\n");
	}
	return 0;
}


#include <iostream>
using namespace std;
int n,a[30001],t,gt;
bool ok;
//------------------------
int main(){
	cin>>n>>t;
	ok=false;
	for (int i=1;i<=n-1;i++) cin>>a[i];
	gt=1;
	do {
		if (gt==t) ok=true;
		else gt=gt+a[gt];
	}  while (gt<t);
	if (ok==true) cout<<"YES";
	else  cout<<"NO";
	return 0;
}


#include <stdio.h>

const int MAX = 3e4 + 1;
int n, t, a[MAX];
bool fr[MAX], res;

void visit(const int& u){
    fr[u] = true;
    if (u == t)
        res = true;
    if (u + a[u] <= n && !fr[u + a[u]])
        visit(u + a[u]);
}

int main(){
    //freopen("in.txt", "r", stdin);
    scanf("%d %d", &n, &t);
    for (int i = 1; i <= n; ++i)
        scanf("%d", a + i);

    visit(1);
    if (res)
        printf("YES");
    else
        printf("NO");

    return 0;
}


#include<iostream>
using namespace std;
	int n,t,a[40000];
//........................................
int main(){
	cin>>n>>t;
	for(int i=1;i<=n-1;i++) cin>>a[i];
	int i=1,cell=1;
	while (cell<=t){
		if (i+a[i]==t){
			cout<<"YES";
			return 0;
		}
		else{
			if (i+a[i]>t){
				cout<<"NO";
				return 0;
			}
			else{
				cell=i+a[i];
				i=cell;
			}
		}
	}
}


#include<stdio.h>
int main()
{
	int a[30010];
    int n,t,s=0,i=1;
    scanf("%d%d",&n,&t);
    for(i=1;i<n;i++)scanf("%d",&a[i]);
	i=1;
    while(1)
	{
        if(i>=n)break;
        i=i+a[i];
        if(i==t){s=1;break;}
    }
    if(s)printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include <stdio.h>

int main()
{
    int n, t;
    int a[30001];

    scanf("%d%d", &n, &t);
    for(int i = 1; i < n; i++)
        scanf("%d", &a[i]);

    int now = 1;
    while(now < t)
        now += a[now];

    if(now == t) printf("YES");
    else printf("NO");

    return 0;
}


var n,t,i,res:longint;
    a:array[1..10009] of longint;
    check:array[1..10009] of boolean;
begin
  read(n,t);
  for i:=1 to n-1 do
    read(a[i]);
  res:=1;
  check[1]:=true;
  While res<t do
    begin
      res:=res+a[res];

    end;
  if res=t then Write('YES')
  else Write('NO');
end.


#include<stdio.h>
int main()
{
	int n,t,a[30005],i,s;
	while(scanf("%d%d",&n,&t)!=EOF)
	{
		for(s=1,i=1;i<n;i++)scanf("%d",&a[i]);
		for(i=1;i<n;i++){i+=a[i];if(i==t){s=0;break;}}
		if(s) printf("NO\n");
		else printf("YES\n");
	}
	return 0;
}


#include <stdio.h>
#include <string>
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;
#pragma warning(disable: 4996)
#define MAX 30005

int a[MAX];
int visit[MAX];

void bfs(int t)
{
	queue<int> q;
	q.push(1);
	visit[1] = true;
	while (!q.empty())
	{
		int f = q.front();
		q.pop();
		if (f == t)
			return;
		int next = f + a[f];
		if (visit[next] == false)
		{
			visit[next] = true;
			q.push(next);
		}
	}
}

int main()
{
	//freopen("input.txt", "rt", stdin);
	ios_base::sync_with_stdio(false);
	int n, t;
	cin >> n >> t;
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
	}
	bfs(t);
	if (visit[t] == true)
	{
		cout << "YES";
	}
	else
	{
		cout << "NO";
	}
}


#include <stdio.h>
#include <string.h>

using namespace std;

int n,t;
int a[3*10000+10];
bool f[3*10000+10];

int main(){
	scanf("%d%d",&n,&t);
		memset(f,0,sizeof(f));
		f[1]=1;
		for(int i=1;i<n;i++)scanf("%d",&a[i]);

		int index=1;
		while(1){
			index +=a[index];
			f[index]=1;
			if(index>=n)break;
		}
		if(f[t])printf("YES\n");
		else printf("NO\n");

	return 0;
}


#include<stdio.h>
int a[30010];
int main()
{
    int n,t;
    bool flag=0;
    scanf("%d%d",&n,&t);
    for(i=1;i<=n-1;i++){
        scanf("%d",&a[i]);
    }
    i=1;
    while(1){
        if(i>=n)break;
        i=i+a[i];
        if(i==t){
                flag=1;
                break;
        }
    }
    if(flag)printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include <bits/stdc++.h>;
using namespace std;
int n,t;
vector<vector<int> > D;
void dfs(int q)
{

        for(int b=0;b<D[q].size();b++)
        {
            if(D[q][b]==t-1)
            {
                cout<<"YES";
                exit(0);
            }
            dfs(D[q][b]);
        }
}
int main()
{
    cin>>n>>t;
    for(int i=0;i<n;i++)
    {
        vector<int> z;
        D.push_back(z);
    }
    int z;

    for(int i=0;i<n-1;i++)
    {
        cin>>z;
        D[i].push_back(i+z);
    }
    dfs(0);
    cout<<"NO";
    return 0;

}


#include <bits/stdc++.h>;
using namespace std;
int n,t;
int a[10000][10000];
void dfs(int q)
{
    for(int b=0;b<n;b++)
    {
        if(a[q][b]==1)
        {
            if(b==t-1)
            {
                cout<<"YES";
                exit(0);
            }
            dfs(b);
        }
    }
}
int main()
{
    cin>>n>>t;
    int z;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            a[i][j]=0;
        }
    }
    for(int i=0;i<n-1;i++)
    {
        cin>>z;
        a[i][z+i]=1;
    }
    dfs(0);
    cout<<"NO";
    return 0;

}


#include <bits/stdc++.h>;
using namespace std;
int n,t;
vector<vector<int> > D;
void dfs(int q)
{

        for(int b=0;b<D[a].size();b++)
        {
            if(D[q][b]==t-1)
            {
                cout<<"YES";
                exit(0);
            }
            dfs(D[a][b]);
        }

}
int main()
{
    cin>>n>>t;
    for(int i=0;i<n;i++)
    {
        vector<int> z;
        D.push_back(z);
    }
    int z;

    for(int i=0;i<n-1;i++)
    {
        cin>>z;
        D[i].push_back(i+z);
    }
    dfs(0);
    cout<<"NO";
    return 0;

}


#include <bits/stdc++.h>;
using namespace std;
int n,t;
int a[30000];
void dfs(int q)
{
        if(a[q]==t-1)
        {
            cout<<"YES";
            exit(0);
        }
        if(a[q]==n-1)
            return;
        dfs(a[q]);

}
int main()
{

    cin>>n>>t;
    int z;
    for(int i=0;i<n-1;i++)
    {
        cin>>z;
        a[i]=z+i;
    }
    dfs(0);
    cout<<"NO";
    return 0;

}


#include <bits/stdc++.h>;
using namespace std;
int n,t;
vector<vector<int> > D;
void dfs(int q)
{
    for(int a=q;a<n;a++)
    {
        for(int b=0;b<D[q].size();b++)
        {
            if(D[a][b]==t-1)
            {
                cout<<"YES";
                exit(0);
            }
            dfs(D[a][b]);
        }
    }
}
int main()
{
    cin>>n>>t;
    for(int i=0;i<n;i++)
    {
        vector<int> z;
        D.push_back(z);
    }
    int z;

    for(int i=0;i<n-1;i++)
    {
        cin>>z;
        D[i].push_back(i+z);
    }
    dfs(0);
    cout<<"NO";
    return 0;

}


#include <bits/stdc++.h>;
using namespace std;
int n,t;
int a[10000][10000];
void dfs(int q)
{
    for(int b=0;b<n;b++)
    {
        if(a[q][b]==1)
        {
            if(b==t-1)
            {
                cout<<"YES";
                exit(0);
            }
            dfs(b);
        }
    }
}
int main()
{
    cin>>n>>t;
    int z;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            a[i][j]=0;
        }
    }
    for(int i=0;i<n-1;i++)
    {
        cin>>z;
        a[i][z+i]=1;
    }
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n-1;j++)
            cout<<a[i][j]<<" ";
        cout<<a[i][n-1]<<endl;
    }
    dfs(0);
    cout<<"NO";
    return 0;

}


#include <bits/stdc++.h>;
using namespace std;
int n,t;
int a[30001][30001];
void dfs(int q)
{
    for(int b=0;b<n;b++)
    {
        if(a[q][b]==1)
        {
            if(b==t-1)
            {
                cout<<"YES";
                exit(0);
            }
            dfs(b);
        }
    }
}
int main()
{
    cin>>n>>t;
    int z;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            a[i][j]=0;
        }
    }
    for(int i=0;i<n-1;i++)
    {
        cin>>z;
        a[i][z+i]=1;
    }
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n-1;j++)
            cout<<a[i][j]<<" ";
        cout<<a[i][n-1]<<endl;
    }
    dfs(0);
    cout<<"NO";
    return 0;

}


#include <bits/stdc++.h>;
using namespace std;
int n,t;
vector<vector<int> > D;
void dfs(int q)
{
    for(int a=q;a<n;a++)
    {
        for(int b=0;b<D[a].size();b++)
        {
            if(D[a][b]==t-1)
            {
                cout<<"YES";
                exit(0);
            }
            dfs(D[a][b]);
        }
    }
}
int main()
{
    cin>>n>>t;
    for(int i=0;i<n;i++)
    {
        vector<int> z;
        D.push_back(z);
    }
    int z;

    for(int i=0;i<n-1;i++)
    {
        cin>>z;
        D[i].push_back(i+z);
    }
    dfs(0);
    cout<<"NO";
    return 0;

}


#include<bits/stdc++.h>
#define s(g) scanf("%d", &g);
using namespace std;
int main(){
    int n,t,temp;
    temp=s(n);
    temp=s(t);
    int a[n+1],v[n+1]={0};
    for(int i=1; i<n; i++){
        temp=s(a[i]);
    }
    int i=1;
    while(i<=n){
        v[i]=1;
        i+=a[i];
    }
    if(v[t]) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,t,a[3001],v[3001]={0};
    cin>>n>>t;
    for(int i=1; i<n; i++){
        cin>>a[i];
    }
    int i=1;
    int f=0;

    while(i<n && v[t]==0){
        v[i]=1;
        i+=a[i];
    }
    if(v[t]) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
#define s(g) scanf("%d", &g);
using namespace std;
int main(){
    int n,t,a[100001],v[100001]={0},temp;
    temp=s(n);
    temp=s(t);

    for(int i=1; i<n; i++){
        temp=s(a[i]);
    }
    int i=1;
    while(i<=n){
        v[i]=1;
        i+=a[i];
    }
    if(v[t]==1) cout<<"YES"<<endl;
    else if(v[i]==0) cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
#define s(g) scanf("%d", &g);
using namespace std;
int main(){
    int n,t,a[3001],v[3001]={0},temp;
    temp=s(n);
    temp=s(t);

    for(int i=1; i<n; i++){
        temp=s(a[i]);
    }
    int i=1;
    while(i<=n){
        v[i]=1;
        i+=a[i];
    }
    if(v[t]) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,t,a[3001],v[3001]={0};
    cin>>n>>t;
    for(int i=1; i<n; i++){
        cin>>a[i];
    }
    int i=1;
    while(i<=n && v[t]==0){
        v[i]=1;
        i+=a[i];
    }
    if(v[t]) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
#define s(g) scanf("%d", &g);
using namespace std;
int main(){
    int n,t,temp;
    temp=s(n);
    temp=s(t);
    int a[n+1], v[1000000]={0};
    for(int i=1; i<n; i++){
        temp=s(a[i]);
    }
    int i=1;
    while(i<=n){
        v[i]=1;
        i+=a[i];
    }
    if(v[t]) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
#define s(g) scanf("%d", &g);
using namespace std;
int main(){
    int n,t,a[3001],v[3001]={0},temp;
    temp=s(n);
    temp=s(t);

    for(int i=1; i<n; i++){
        temp=s(a[i]);
    }
    int i=1;
    while(i<n){
        v[i]=1;
        i+=a[i];
    }
    if(v[t]) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,t,a[3001];
    cin>>n>>t;
    for(int i=1; i<n; i++){
        cin>>a[i];
    }
    int i=1;
    int f=0;
    bool visited=false;
    while(f==0){
        if(i==t){
            f=1;
            visited=true;
        }
        else if(i>=n){ f=1; }
        i+=a[i];

    }
    if(visited) cout<<"YES"<<endl;
    if(!visited) cout<<"NO"<<endl;

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,t,a[3001];
    cin>>n>>t;
    for(int i=1; i<n; i++){
        cin>>a[i];
    }
    int i=1;
    int f=0;
    bool visited=false;
    while(f==0){
        if(i==t){
            f=1;
            visited=true;
        }
        else if(i>=n || i>t){ f=1; }
        i+=a[i];

    }
    if(visited) cout<<"YES"<<endl;
    if(!visited) cout<<"NO"<<endl;

}


#include<stdio.h>
#include<queue>
#include<algorithm>
#include<string>
#include<math.h>
#include <bits/stdc++.h>
#define MAX 100000
#define M 1000000007
#define scll(t) cin>>t
#define scl(t) cin>>t
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
#define ll long long
using namespace std;
int main()
{
    ll n,i,k,a[100000],b[100000];
     scll(n);
     scll(k);
     for(i=1;i<n;i++)
     {
         scll(a[i]);
         b[i]=i;
     }
     for(i=1;i<n;i++)
     {
         b[i]+=a[i];
     }

         i=1;
         while(i<=n-1&&k>b[i])
            i++;
         if(i<=n-1&&k==b[i])
            cout<<"YES";
         else
            cout<<"NO";

    return 0;
}


#include<stdio.h>
#include<queue>
#include<algorithm>
#include<string>
#include<math.h>
#include <bits/stdc++.h>
#define MAX 100000
#define M 1000000007
#define scll(t) cin>>t
#define scl(t) cin>>t
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
#define ll long long
using namespace std;
int main()
{
    ll n,i,k,a[100000],b[100000];
     scll(n);
     scll(k);
     b[0]=1;
     for(i=1;i<=n-1;i++)
     {
         scll(a[i]);

     }

         i=1;
         while(i<k)
            i=i+a[i];
         if(k==i)
            cout<<"YES";
         else
            cout<<"NO";

    return 0;
}


#include<stdio.h>
#include<queue>
#include<algorithm>
#include<string>
#include<math.h>
#include <bits/stdc++.h>
#define MAX 100000
#define M 1000000007
#define scll(t) cin>>t
#define scl(t) cin>>t
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
#define ll long long
using namespace std;
int main()
{
    ll n,i,k,a[100000],b[100000];
     scll(n);
     scll(k);
     b[0]=1;
     for(i=1;i<=n-1;i++)
     {
         scll(a[i]);
         b[i]=i;
     }
     for(i=1;i<=n-1;i++)
     {
         b[i]+=a[i];
     }
     sort(b,b+n);

         i=0;
         while(i<=n&&k>b[i])
            i++;
         if(i<=n&&k==b[i])
            cout<<"YES";
         else
            cout<<"NO";

    return 0;
}


#include<stdio.h>
#include<queue>
#include<algorithm>
#include<string>
#include<math.h>
#include <bits/stdc++.h>
#define MAX 100000
#define M 1000000007
#define scll(t) cin>>t
#define scl(t) cin>>t
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
#define ll long long
using namespace std;
int main()
{
    ll n,i,k,a[100000],b[100000];
     scll(n);
     scll(k);
     b[0]=1;
     for(i=1;i<=n-1;i++)
     {
         scll(a[i]);

     }

         i=1;
         while(i<n&&k<a[i])
            i=i+a[i];
         if(i<n&&k==a[i])
            cout<<"YES";
         else
            cout<<"NO";

    return 0;
}


#include<stdio.h>
#include<queue>
#include<algorithm>
#include<string>
#include<math.h>
#include <bits/stdc++.h>
#define MAX 100000
#define M 1000000007
#define scll(t) cin>>t
#define scl(t) cin>>t
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
#define ll long long
using namespace std;
int main()
{
    ll n,i,k,a[100000],b[100000];
     scll(n);
     scll(k);
     for(i=0;i<n-1;i++)
     {
         scll(a[i]);
         b[i]=i+1;
     }
     for(i=0;i<n-1;i++)
     {
         b[i]+=a[i];
     }
     sort(b,b+n-1);

         i=1;
         while(i<=n-1&&k>b[i])
            i++;
         if(i<=n-1&&k==b[i])
            cout<<"YES";
         else
            cout<<"NO";

    return 0;
}


#include<stdio.h>
#include<queue>
#include<algorithm>
#include<string>
#include<math.h>
#include <bits/stdc++.h>
#define MAX 100000
#define M 1000000007
#define scll(t) cin>>t
#define scl(t) cin>>t
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
#define ll long long
using namespace std;
int main()
{
    ll n,i,k,a[100000],b[100000];
     scll(n);
     scll(k);
     for(i=0;i<n-1;i++)
     {
         scll(a[i]);
         b[i]=i+1;
     }
     for(i=0;i<n-1;i++)
     {
         b[i]+=a[i];
     }
     sort(b,b+n-1);

         i=0;
         while(i<n&&k>b[i])
            i++;
         if(i<n&&k==b[i])
            cout<<"YES";
         else
            cout<<"NO";

    return 0;
}


#include<stdio.h>
#include<queue>
#include<algorithm>
#include<string>
#include<math.h>
#include <bits/stdc++.h>
#define MAX 100000
#define M 1000000007
#define scll(t) cin>>t
#define scl(t) cin>>t
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
#define ll long long
using namespace std;
int main()
{
    ll n,i,k,a[100000],b[100000];
     scll(n);
     scll(k);
     for(i=1;i<n;i++)
     {
         scll(a[i]);
         b[i]=i;
     }
     for(i=1;i<n;i++)
     {
         b[i]+=a[i];
     }
     sort(b+1,b+n-1);

         i=1;
         while(i<=n-1&&k>b[i])
            i++;
         if(i<=n-1&&k==b[i])
            cout<<"YES";
         else
            cout<<"NO";

    return 0;
}


#include<stdio.h>
#include<queue>
#include<algorithm>
#include<string>
#include<math.h>
#include <bits/stdc++.h>
#define MAX 100000
#define M 1000000007
#define scll(t) cin>>t
#define scl(t) cin>>t
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
#define ll long long
using namespace std;
int main()
{
    ll n,i,k,a[100000],b[100000];
     scll(n);
     scll(k);
     for(i=1;i<n;i++)
     {
         scll(a[i]);
         b[i]=i;
     }
     for(i=1;i<n;i++)
     {
         b[i]+=a[i];
     }

     if(k==1)
        cout<<"YES";
     else
     {
         i=1;
         while(i<=n-1&&k>b[i])
            i++;
         if(i<=n-1&&k==b[i])
            cout<<"YES";
         else
            cout<<"YES";
     }
    return 0;
}


#include<stdio.h>
#include<queue>
#include<algorithm>
#include<string>
#include<math.h>
#include <bits/stdc++.h>
#define MAX 100000
#define M 1000000007
#define scll(t) cin>>t
#define scl(t) cin>>t
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
#define ll long long
using namespace std;
int main()
{
    ll n,i,k,a[100000],b[100000];
     scll(n);
     scll(k);
     b[0]=1;
     for(i=1;i<=n-1;i++)
     {
         scll(a[i]);
         b[i]=i;
     }
     for(i=2;i<=n-1;i++)
     {
         a[i]+=a[i-1];
     }

         i=1;
         while(i<n&&k>a[i])
            i++;
         if(i<n&&k==a[i])
            cout<<"YES";
         else
            cout<<"NO";

    return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>
#include<functional>
#include<string>
#include<ctime>
using namespace std;

int main(){

 //freopen("a.txt","r",stdin);

int n,t,a[100000];
scanf("%d%d",&n,&t);

//cin>>n>>t;

for(int i=1;i<n && i<=t;i++)
{
    //cin>>a[i];
    scanf("%d",&a[i]);

// cout<<i<<"  ";

}

int flag=0;

for(int i=1;i<n;)
{
      //cout<<i<<" ";
    if(i==t){flag=1;break;}
    i+=a[i];

if(i>t){break;}
}
if(flag==1) printf("YES");
else printf("NO");
return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>
#include<functional>
#include<string>
#include<ctime>
using namespace std;

int main(){

 freopen("a.txt","r",stdin);

int n,t,a[100000];
scanf("%d%d",&n,&t);

//cin>>n>>t;

for(int i=1;i<n && i<=t;i++)
{
    //cin>>a[i];
    scanf("%d",&a[i]);

// cout<<i<<"  ";

}

int flag=0;

for(int i=1;i<n;)
{
      //cout<<i<<" ";

    i+=a[i];
    if(i==t){flag=1;break;}

if(i>t){break;}
}
if(flag==1) printf("YES\n");
else printf("NO\n");
return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>
#include<functional>
#include<string>
#include<ctime>
using namespace std;

int main(){

 //freopen("a.txt","r",stdin);

int n,t,a[10000];
scanf("%d%d",&n,&t);

for(int i=1;i<=n;i++)
{
a[i]=0;

}

//cin>>n>>t;

for(int i=1;i<n && i<=t;i++)
{
    //cin>>a[i];
    scanf("%d",&a[i]);
// cout<<i<<"  ";

}

int flag=0;

for(int i=1;i<n;)
{
      //cout<<i<<" ";
    if(i==t){flag=1;break;}
    i+=a[i];

if(i>t){break;}
}
if(flag==1) printf("YES");
else printf("NO");
return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>
#include<functional>
#include<string>
#include<ctime>
using namespace std;

int main(){

 //freopen("a.txt","r",stdin);

int n,t,a[10000];
//cin>>n>>t;
scanf("%d%d",&n,&t);
for(int i=1;i<n && i<=t;i++)
{
    //cin>>a[i];
    scanf("%d",&a[i]);
// cout<<i<<"  ";

}

int flag=0;

for(int i=1;i<n;)
{
      //cout<<i<<" ";
    if(i==t){flag=1;break;}
    i+=a[i];

if(i>t){break;}
}
if(flag==1) printf("YES");
else printf("NO");
return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>
#include<functional>
#include<string>
#include<ctime>
using namespace std;

int main(){

//freopen("a.txt","r",stdin);

int n,t,a[10000];
//cin>>n>>t;
scanf("%d%d",&n,&t);
for(int i=1;i<n;i++)
{
    //cin>>a[i];
    scanf("%d",&a[i]);

}

int flag=0;

for(int i=1;i<n;)
{
      //cout<<i<<" ";
    if(i==t){flag=1;break;}
    i+=a[i];

if(i>t){break;}
}
if(flag==1) printf("YES");
else printf("NO");
return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>
#include<functional>
#include<string>
#include<ctime>
using namespace std;

int main(){

//freopen("a.txt","r",stdin);

int n,t,a[10000];
cin>>n>>t;
for(int i=1;i<n;i++)
{
    cin>>a[i];

}

int flag=0;

for(int i=1;i<n;)
{
     // cout<<i<<" ";
    if(i==t){flag=1;break;}
    i+=a[i];

if(i>t){break;}
}
if(flag==1) cout<<"YES";
else cout<<"NO";
return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>
#include<functional>
#include<string>
#include<ctime>
using namespace std;

int main(){

 //freopen("a.txt","r",stdin);

int n,t,a[100000];
scanf("%d%d",&n,&t);

//cin>>n>>t;

for(int i=1;i<n;i++)
{
    //cin>>a[i];
    scanf("%d",&a[i]);

// cout<<i<<"  ";

}

int flag=0;

for(int i=1;i<n;)
{
      //cout<<i<<" ";
    if(i==t){flag=1;break;}
    i+=a[i];

if(i>t){break;}
}
if(flag==1) printf("YES\n");
else printf("NO\n");
return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>
#include<functional>
#include<string>
#include<ctime>
using namespace std;

int main(){
//freopen("a.txt","r",stdin);

int n,t,a[100000];
scanf("%d%d",&n,&t);

//cin>>n>>t;

for(int i=1;i<n && i<=t;i++)
{
    //cin>>a[i];
    scanf("%d",&a[i]);

// cout<<i<<"  ";

}

int flag=0;

for(int i=1;i<n;)
{
      //cout<<i<<" ";

    i+=a[i];
    if(i==t){flag=1;break;}

if(i>t){break;}
}
if(flag==1) printf("YES\n");
else printf("NO\n");
return 0;
}


#include<iostream>
using namespace std;
long long n;
struct arr
{
    long long x,y;
};
long long func(struct arr portal[],long long xvalue)
{
    if(xvalue==1)
        return 1;
    for(long long i=1;i<n;i++)
    {
        if(portal[i].y==xvalue)
            return func(portal,portal[i].x);
    }
    return 0;
}
int main()
{
    long long t,i;
    cin>>n>>t;struct arr portal[n];
    for(i=1;i<=n-1;i++)
        cin>>portal[i].x;
    for(i=1;i<=n-1;i++)
        portal[i].y=portal[i].x+i;
    for(i=1;i<=n-1;i++)
    {
        if((portal[i].y) == t)
        {
            if(func(portal,portal[i].x)==1)
                {cout<<"YES"<<endl;return 0;}
        }
    }
    {cout<<"NO"<<endl;}
    return 0;
}


#include<iostream>
using namespace std;
long long n;
struct arr
{
    long long x,y;
};
long long func(struct arr portal[],long long xvalue)
{
    if(xvalue==1)
        return 1;
    for(long long i=1;i<n;i++)
    {
        if(portal[i].y==xvalue)
            return func(portal,portal[i].x);
    }
    return 0;
}
int main()
{
    long long t,i;
    cin>>n>>t;struct arr portal[n];
    for(i=1;i<=n-1;i++)
        cin>>portal[i].x;
    for(i=1;i<=n-1;i++)
        portal[i].y=portal[i].x+i;
    for(i=1;i<=n-1;i++)
    {
        if((portal[i].y) == t)
        {
            if(func(portal,portal[i].x)==1)
                {cout<<"YES"<<endl;return 0;}
            else {cout<<"NO"<<endl;return 0;}
        }
    }
    {cout<<"NO"<<endl;}
    return 0;
}


#include<iostream>
using namespace std;
long long n;
int main()
{
    long long t,i;
    cin>>n>>t;long long arr[n];
    for(i=1;i<n;i++)
    {
        cin>>arr[i];
    }
    long long x=1;i=1;
    while(x<t)
    {
        x+=arr[i++];
    }
    if(x==t)
        cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <stack>
#include <unordered_set>
#include <string>
#include <set>
#include <algorithm>

using namespace std;

int main() {

    //freopen("input.txt", "r", stdin);
    //int N = 0;
    //cin >> N;
    //freopen("output.txt", "w", stdout);

    //for (int o = 0; o < N; o++) {
    //}

    string s;
    cin >> s;

    vector<vector<int>> ans;
    int steps = 0;
    while (s.size() > 0) {
        vector<int> del(s.size() + 1, 0);
        string new_s;
        steps += 1;

        int l = 0;
        int r = s.size() - 1;

        while (l < r) {
            if (s[l] == '(') {
                while (s[r] != ')' && r > l) {
                    r -= 1;
                }
                if (r == l) {
                    break;
                }
                else {
                    //cout << "hui" << l << ' ' << r << endl;
                    del[l] = 1;
                    del[r] = 1;
                    del.back() += 2;
                    r -= 1;
                }
            }
            l += 1;
        }

        for (int i = 0; i < del.size() - 1; i++) {
            if (del[i] == 0) {
                new_s.push_back(s[i]);
            }
        }
        if (new_s.size() == s.size()) {
            break;
        }
        s = new_s;
        ans.push_back(del);

    }
    cout << steps - 1 << endl;
    for (int i = 0; i < steps - 1; i++) {
        cout << ans[i].back() << endl;
        for (int j = 0; j < ans[i].size() - 1; j++) {
            if (ans[i][j] == 1) {
                cout << j + 1 << ' ';
            }
        }
        cout << endl;
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <stack>
#include <unordered_set>
#include <string>
#include <set>
#include <algorithm>

using namespace std;

int main() {

    //freopen("input.txt", "r", stdin);
    //int N = 0;
    //cin >> N;
    //freopen("output.txt", "w", stdout);

    //for (int o = 0; o < N; o++) {
    //}

    string s;
    cin >> s;

    vector<vector<int>> ans;
    int steps = 0;
    while (s.size() > 0) {
        vector<int> del(s.size() + 1, 0);
        string new_s;
        steps += 1;

        int l = 0;
        int r = s.size() - 1;

        while (l < r) {
            if (s[l] == '(') {
                while (s[r] != ')' && r > l) {
                    r -= 1;
                }
                if (r == l) {
                    break;
                }
                else {
                    //cout << "hui" << l << ' ' << r << endl;
                    del[l] = 1;
                    del[r] = 1;
                    del.back() += 2;
                    r -= 1;
                }
            }
            l += 1;
        }

        for (int i = 0; i < del.size() - 1; i++) {
            if (del[i] == 0) {
                new_s.push_back(s[i]);
            }
        }
        s = new_s;
        ans.push_back(del);
        if (new_s.size() == s.size()) {
            break;
        }

    }
    if (steps == 1) {
        steps += 1;
    }
    cout << steps - 1 << endl;
    for (int i = 0; i < steps - 1; i++) {
        cout << ans[i].back() << endl;
        for (int j = 0; j < ans[i].size() - 1; j++) {
            if (ans[i][j] == 1) {
                cout << j + 1 << ' ';
            }
        }
        cout << endl;
    }
    return 0;
}


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

int main(){
	string s;
	cin >> s;

	int numO = 0, numC =0;

	for(int i=0; i<s.length()/2+1;i++){
		if(s[i]=='('){
			numO++;
		}
	}
	for(int i=s.length()/2; i<s.length();i++){
		if(s[i]==')'){
			numC++;
		}
	}

	numO = min(numO,numC);
	numC = min(numO, numC);

	if (numO==0) {
		cout << 0;
	}

	else {
		cout << 1 << "\n" << numO+numC << "\n";
		for(int i=0; i<s.length()/2+1;i++){
			if(s[i]=='('){
				cout << i+1 << " ";
				numO--;
			}
			if(numO==0) {
				break;
			}

		}
		for(int i=s.length()/2; i<s.length();i++){
			if(s[i]==')'){
				cout << i+1 << " ";
				numC--;
			}
			if (numC == 0) {
				break;
			}
		}
	}
}


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

int main(){
	string s;
	cin >> s;

	int numO = 0, numC =0;

	for(int i=0; i<s.length()/2;i++){
		if(s[i]=='('){
			numO++;
		}
	}
	for(int i=s.length()/2; i<s.length();i++){
		if(s[i]==')'){
			numC++;
		}
	}

	numO = min(numO,numC);
	numC = min(numO, numC);

	if (numO==0) {
		cout << 0;
	}

	else {
		cout << 1 << "\n" << numO+numC << "\n";
		for(int i=0; i<s.length()/2+1;i++){
			if(s[i]=='('){
				cout << i+1 << " ";
				numO--;
			}
			if(numO==0) {
				break;
			}

		}
		for(int i=s.length()/2; i<s.length();i++){
			if(s[i]==')'){
				cout << i+1 << " ";
				numC--;
			}
			if (numC == 0) {
				break;
			}
		}
	}
}


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

int main(){
	string s;
	cin >> s;

	int numO = 0, numC =0;

	for(int i=0; i<s.length()/2+1;i++){
		if(s[i]=='('){
			numO++;
		}
	}
	for(int i=s.length()/2; i<s.length();i++){
		if(s[i]==')'){
			numC++;
		}
	}

	numO = min(numO,numC);
	numC = min(numO, numC);

	if (numO==0) {
		cout << 0;
	}

	else {
		cout << 1 << "\n";
		for(int i=0; i<s.length()/2+1;i++){
			if(s[i]=='('){
				cout << i+1 << " ";
				numO--;
			}
			if(numO==0) {
				break;
			}

		}
		for(int i=s.length()/2; i<s.length();i++){
			if(s[i]==')'){
				cout << i+1 << " ";
				numC--;
			}
			if (numC == 0) {
				break;
			}
		}
	}
}


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

#define endl '\n'

int main(){
	string s;
	cin >> s;
	vector<int>lp,rp;
	int rm = s.length()-1;

	for (int i = 0; i < s.length(); i++) {
		if(i>=rm){
			break;
		}
		if (s[i]=='('){
			for(int x = rm; x > i; x--) {
				if (s[x]==')'){
					lp.push_back(i+1);
					rp.push_back(x+1);
					rm=x-1;
					break;
				}
			}
		}
	}

	if(lp.size()==0){
		cout << "0\n";
	}
	else{
		cout<<"1"<<endl;
		cout<<lp.size()+rp.size()<<endl;
		for(int i=0;i<lp.size();i++){
			cout << lp[i] << " ";
		}
		reverse(rp.begin(), rp.end());
		for(int i=0;i<rp.size();i++){
			cout<<rp[i]<<" ";
		}
	}
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
using namespace std;
vector<int>a;
int main()
{
	string s1,s2;
	cin>>s1;
	int flag=0,cnt=0;
    while(s1[cnt]!='(')
	cnt++;
    for(int i=cnt;i<s1.length();i++)
    if(s1[i]==')')
    {
     flag=1;
	 break;
    }
	if(!flag)
	{
	 cout<<0<<endl;
	}
	else
	{
      int j=cnt,i=s1.length()-1;
	  while(j<i)
	  {
	    if(s1[i]!=')')
	    i--;
	    if(s1[j]!='(')
	    j++;
	    if(s1[i]==')'&&s1[j]=='(')
	    {
	    	a.push_back(i+1);
			a.push_back(j+1);
	     	i--;
			j++;
	    }
	    if(i-1<j+1)
	    break;
	  }
	}
	sort(a.begin(),a.end());
	cout<<1<<endl;
	cout<<a.size()<<endl;
	for(int i=0;i<a.size();i++)
	cout<<a[i]<<" ";
	cout<<endl;
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
using namespace std;
vector<int>a;
int main()
{
	string s1,s2;
	cin>>s1;
	int flag=0,cnt=0;
    while(s1[cnt]!='(')
	cnt++;
    for(int i=cnt;i<s1.length();i++)
    if(s1[i]==')')
    {
     flag=1;
	 break;
    }
	if(!flag)
	{
	 cout<<0<<endl;
	 return 0;
	}
	else
	{
      int j=cnt,i=s1.length()-1;
	  while(j<i)
	  {

	    if(s1[i]==')'&&s1[j]=='(')
	    {
	    	a.push_back(i+1);
			a.push_back(j+1);
	     	i--;
			j++;
	    }
	    if(s1[i]!=')')
	    i--;
	    if(s1[j]!='(')
	    j++;
	  }
	}
	sort(a.begin(),a.end());
	cout<<1<<endl;
	cout<<a.size()<<endl;
	for(int i=0;i<a.size();i++)
	cout<<a[i]<<" ";
	cout<<endl;
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
using namespace std;
vector<int>a;
int main()
{
	string s1,s2;
	cin>>s1;
	int flag=0,cnt=0;
    while(s1[cnt]!='(')
	cnt++;
    for(int i=cnt;i<s1.length();i++)
    if(s1[i]==')')
    {
     flag=1;
	 break;
    }
	if(!flag)
	{
	 cout<<0<<endl;
	 return 0;
	}
	else
	{
      int j=cnt,i=s1.length()-1;
	  while(j<i)
	  {
	    if(s1[i]!=')')
	    i--;
	    if(s1[j]!='(')
	    j++;
	    if(s1[i]==')'&&s1[j]=='(')
	    {
	    	a.push_back(i+1);
			a.push_back(j+1);
	     	i--;
			j++;
	    }
	    if(i-1<j+1)
	    break;
	  }
	}
	sort(a.begin(),a.end());
	cout<<1<<endl;
	cout<<a.size()<<endl;
	for(int i=0;i<a.size();i++)
	cout<<a[i]<<" ";
	cout<<endl;
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
using namespace std;
vector<int>a;
int main()
{
	string s1,s2;
	cin>>s1;
	int flag=0,cnt=0;
    while(s1[cnt]!='(')
	cnt++;
    for(int i=cnt;i<s1.length();i++)
    if(s1[i]==')')
    {
     flag=1;
	 break;
    }
	if(!flag)
	{
	 cout<<0<<endl;
	 return 0;
	}
	else
	{
      int j=cnt,i=s1.length()-1;
	  while(j<i)
	  {
	    if(s1[i]!=')')
	    i--;
	    if(s1[j]!='(')
	    j++;
	    if(s1[i]==')'&&s1[j]=='(')
	    {
	    	a.push_back(i+1);
			a.push_back(j+1);
	     	i--;
			j++;
	    }
	    if(i==j+1)
	    break;
	  }
	}
	sort(a.begin(),a.end());
	cout<<1<<endl;
	cout<<a.size()<<endl;
	for(int i=0;i<a.size();i++)
	cout<<a[i]<<" ";
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    string str;cin>>str;
    stack<int > sta;
    int n=str.size();
    vector<int> ans;
    int suc=0;
    for(int i=0;i<n;i++){
        if(str[i]=='(')sta.push(i);
        else{
            if(sta.size()){
                suc=1;
                // cerr<<i<<" "<<sta.top()<<endl;
                ans.push_back(sta.top());
                ans.push_back(i);
                sta.pop();
            }
        }
    }
    if(!suc){
        cout<<0<<endl;
        return 0;
    }
    cout<<1<<endl;

    cout<<ans.size()<<endl;
    for(auto it:ans)cout<<it+1<<" ";
       cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    string str;cin>>str;
    stack<int > sta;
    int n=str.size();
    vector<int> ans;
    int suc=0;
    for(int i=0;i<n;i++){
        if(str[i]=='(')sta.push(i);
        else{
            if(sta.size()){
                suc=1;
                // cerr<<i<<" "<<sta.top()<<endl;
                ans.push_back(sta.top());
                ans.push_back(i);
                sta.pop();
            }
        }
    }
    if(!suc){
        cout<<0<<endl;
        return 0;
    }
    cout<<1<<endl;
    cout<<n<<endl;
    for(int i=0;i<n;i++)cout<<i+1<<" ";
    cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN=1010;
int lazy[MAXN];
int main(){
    string str;cin>>str;
    // interesting
    int i=0;
    int n=str.size();
    int j=n-1;
    vector<vector<int>> ans;

    while(1){
    int suc=0;
    ans.push_back(vector<int>());
    while(i<j){
        // cerr<<i<<" "<<j<<endl;
        while((i<n&&lazy[i]==1) || (i<n&&str[i]==')'))i++;
        if(i>=j)break;
        while((j>=0 && str[j]=='(')||(j>=0 && lazy[j]==1))j--;
        if(j<=i)break;
        suc=1;
        lazy[i]=1;
        lazy[j]=1;
        ans.back().push_back(i);
        ans.back().push_back(j);
        i++;j--;
    }
    if(!suc){
        ans.erase(prev(ans.end()));
        break;
    }
    }
    if(!ans.size()){
        cout<<0<<endl;
        return 0;
    }
    cout<<ans.size()<<endl;
   for(int i=0;i<(int)ans.size();i++){
       if(!ans[i].size())break;
       cout<<ans[i].size()<<endl;
       sort(ans[i].begin(),ans[i].end());
       for(int j=0;j<(int)ans[i].size();j++){
           cout<<ans[i][j]+1<<" ";
       }
       cout<<endl;
   }
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN=1010;
int lazy[MAXN];
int main(){
    string str;cin>>str;
    // interesting
    int i=0;
    int n=str.size();
    int j=n-1;
    vector<int> ans;

    while(i<j){
        // cerr<<i<<" "<<j<<endl;
        while((i<n&&lazy[i]==1) || (i<n&&str[i]==')'))i++;
        if(i>=j)break;
        while((j>=0 && str[j]=='(')||(j>=0 && lazy[j]==1))j--;
        if(j<=i)break;
        lazy[i]=1;
        lazy[j]=1;
        ans.push_back(i);
        ans.push_back(j);
        i++;j--;
    }

    if(!ans.size()){
        cout<<0<<endl;
        return 0;
    }
   cout<<1<<endl;
   cout<<ans.size()<<endl;
   sort(ans.begin(),ans.end());
   for(auto it:ans)cout<<it+1<<" ";
   cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN=1010;
int lazy[MAXN];
int main(){
    string str;cin>>str;
    // interesting
    int i=0;
    int n=str.size();
    int j=n-1;
    vector<vector<int>> ans;

    while(1){
    int suc=0;
    ans.push_back(vector<int>());
    while(i<j){
        // cerr<<i<<" "<<j<<endl;
        while((i<n&&lazy[i]==1) || (i<n&&str[i]==')'))i++;
        if(i>=j)break;
        while((j>=0 && str[j]=='(')||(j>=0 && lazy[j]==1))j--;
        if(j<=i)break;
        suc=1;
        lazy[i]=1;
        lazy[j]=1;
        ans.back().push_back(i);
        ans.back().push_back(j);
        i++;j--;
    }
    if(!suc)break;
    }
    if(!ans.size()){
        cout<<0<<endl;
        return 0;
    }
    cout<<ans.size()<<endl;
   for(int i=0;i<(int)ans.size();i++){
       if(!ans[i].size())break;
       cout<<ans[i].size()<<endl;
       for(int j=0;j<(int)ans[i].size();j++){
           cout<<ans[i][j]+1<<" ";
       }
       cout<<endl;
   }
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    string str;cin>>str;
    stack<int > sta;
    int n=str.size();
    vector<int> ans;
    int suc=0;
    for(int i=0;i<n;i++){
        if(str[i]=='(')sta.push(i);
        else{
            if(sta.size()){
                suc=1;
                break;
            }
        }
    }
    if(!suc){
        cout<<0<<endl;
        return 0;
    }
    cout<<1<<endl;
    for(int i=0;i<(int)str.size();i++){
        if(str[i]==')')ans.push_back(i+1);
    }
    cout<<ans.size()<<endl;
    for(auto it:ans)cout<<it<<" ";
       cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    string str;cin>>str;
    // interesting
    int i=0;
    int n=str.size();
    int j=n-1;
    vector<int> ans;
    while(i<j){
        // cerr<<i<<" "<<j<<endl;
        while(i<n&&str[i]==')')i++;
        if(i>=j)break;
        while(j>=0 && str[j]=='(')j--;
        if(j<=i)break;

        ans.push_back(i);
        ans.push_back(j);
        i++;j--;
    }
    if(!ans.size()){
        cout<<0<<endl;
        return 0;
    }
    cout<<1<<endl;
    cout<<ans.size()<<endl;
    for(auto it:ans)cout<<it+1<<" ";
       cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN=1010;
int lazy[MAXN];
int main(){
    string str;cin>>str;
    // interesting
    int i=0;
    int n=str.size();
    int j=n-1;
    vector<vector<int>> ans;

    while(1){
    int suc=0;
    ans.push_back(vector<int>());
    while(i<j){
        // cerr<<i<<" "<<j<<endl;
        while((i<n&&lazy[i]==1) || (i<n&&str[i]==')'))i++;
        if(i>=j)break;
        while((j>=0 && str[j]=='(')||(j>=0 && lazy[j]==1))j--;
        if(j<=i)break;
        suc=1;
        lazy[i]=1;
        lazy[j]=1;
        ans.back().push_back(i);
        ans.back().push_back(j);
        i++;j--;
    }
    if(!suc){
        ans.erase(prev(ans.end()));
        break;
    }
    }
    if(!ans.size()){
        cout<<0<<endl;
        return 0;
    }
    cout<<ans.size()<<endl;
   for(int i=0;i<(int)ans.size();i++){
       if(!ans[i].size())break;
       cout<<ans[i].size()<<endl;
       for(int j=0;j<(int)ans[i].size();j++){
           cout<<ans[i][j]+1<<" ";
       }
       cout<<endl;
   }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define max_char 26
#define endl '\n'
#define ma 1000000001
#define mod 1000000007
#define f(i,n) for(ll i=0;i<n;i++)
#define f(j,n) for(ll j=0;j<n;j++)
string remove_space(string str)
{
    std::string::iterator end_pos = std::remove(str.begin(), str.end(), ' ');
str.erase(end_pos, str.end());
return str;
}
ll pow(ll a, ll b)
{
    for(ll i=0;i<b;i++)
        a*=a;
    return a;
}
main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    vector <int> open,close;
    int k=0;
    for(int i=0;i<s.length();i++)
    {
        if(s[i]=='(')
            open.push_back(i+1);
        /*else if(s.length()-1-i>=0)
        {
            if(s.length()-1-i>open[k])
            {
                close.insert(close.begin(),s.length()-1-i);
                k++;
            }
        */
    }
    for(int i=s.length()-1;i>=0;i--)
    {
        if(s[i]==')' && open.size()!=0)
        {
            if(i+1>open[k]){
            close.insert(close.begin(),i+1);
                k++;}
            /*else
                break;*/
        }
        if(k>=open.size())
            break;
    }
    if(close.size()!=0){
    cout<<"1\n";}
    cout<<close.size()*2<<"\n";
    for(int i=0;i<close.size();i++)
        cout<<open[i]<<" ";
    for(int i=0;i<close.size();i++)
        cout<<close[i]<<" ";
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define max_char 26
#define endl '\n'
#define ma 1000000001
#define mod 1000000007
#define f(i,n) for(ll i=0;i<n;i++)
#define f(j,n) for(ll j=0;j<n;j++)
string remove_space(string str)
{
    std::string::iterator end_pos = std::remove(str.begin(), str.end(), ' ');
str.erase(end_pos, str.end());
return str;
}
ll pow(ll a, ll b)
{
    for(ll i=0;i<b;i++)
        a*=a;
    return a;
}
main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    vector <int> open,close;
    int k=0;
    for(int i=0;i<s.length();i++)
    {
        if(s[i]=='(')
            open.push_back(i+1);
        /*else if(s.length()-1-i>=0)
        {
            if(s.length()-1-i>open[k])
            {
                close.insert(close.begin(),s.length()-1-i);
                k++;
            }
        */
    }
    for(int i=s.length()-1;i>=0;i--)
    {
        if(s[i]==')')
        {
            if(i+1>open[k]){
            close.insert(close.begin(),i+1);
                k++;}
        }
        if(k>open.size())
            break;
    }
    if(close.size()!=0){
    cout<<"1\n";}
    cout<<close.size()*2<<"\n";
    for(int i=0;i<close.size();i++)
        cout<<open[i]<<" ";
    for(int i=0;i<close.size();i++)
        cout<<close[i]<<" ";
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define max_char 26
#define endl '\n'
#define ma 1000000001
#define mod 1000000007
#define f(i,n) for(ll i=0;i<n;i++)
#define f(j,n) for(ll j=0;j<n;j++)
string remove_space(string str)
{
    std::string::iterator end_pos = std::remove(str.begin(), str.end(), ' ');
str.erase(end_pos, str.end());
return str;
}
ll pow(ll a, ll b)
{
    for(ll i=0;i<b;i++)
        a*=a;
    return a;
}
main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    vector <int> open,close;
    int k=0;
    for(int i=0;i<s.length();i++)
    {
        if(s[i]=='(')
            open.push_back(i+1);
        /*else if(s.length()-1-i>=0)
        {
            if(s.length()-1-i>open[k])
            {
                close.insert(close.begin(),s.length()-1-i);
                k++;
            }
        */
    }
    for(int i=s.length()-1;i>=0;i--)
    {
        if(s[i]==')')
        {
            if(i+1>open[k]){
            close.insert(close.begin(),i+1);
                k++;}
        }
        if(k>open.size())
            break;
    }
    cout<<"1\n";
    cout<<close.size()*2<<"\n";
    for(int i=0;i<close.size();i++)
        cout<<open[i]<<" ";
    for(int i=0;i<close.size();i++)
        cout<<close[i]<<" ";
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define max_char 26
#define endl '\n'
#define ma 1000000001
#define mod 1000000007
#define f(i,n) for(ll i=0;i<n;i++)
#define f(j,n) for(ll j=0;j<n;j++)
string remove_space(string str)
{
    std::string::iterator end_pos = std::remove(str.begin(), str.end(), ' ');
str.erase(end_pos, str.end());
return str;
}
ll pow(ll a, ll b)
{
    for(ll i=0;i<b;i++)
        a*=a;
    return a;
}
main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    vector <int> open,close;
    int k=0;
    for(int i=0;i<s.length();i++)
    {
        if(s[i]=='(')
            open.push_back(i+1);
        /*else if(s.length()-1-i>=0)
        {
            if(s.length()-1-i>open[k])
            {
                close.insert(close.begin(),s.length()-1-i);
                k++;
            }
        */
    }
    for(int i=s.length()-1;i>=0;i--)
    {
        if(s[i]==')' && open.size()!=0)
        {
            if(i+1>open[k]){
            close.insert(close.begin(),i+1);
                k++;}
        }
        if(k>open.size())
            break;
    }
    if(close.size()!=0){
    cout<<"1\n";}
    cout<<close.size()*2<<"\n";
    for(int i=0;i<close.size();i++)
        cout<<open[i]<<" ";
    for(int i=0;i<close.size();i++)
        cout<<close[i]<<" ";
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n,m,cnt[maxn];
char s[maxn];
vector<int> g,h;
vector<int> t[maxn];
int main() {
	scanf("%s",s + 1);
	n = strlen(s + 1);
	for (int i = 1; i <= n; i++)
		if (s[i] == '(') g.push_back(i);
		else h.push_back(i);
	for (int i = n - 1; i >= 0; i--) {
		cnt[i] += cnt[i + 1];
		if (s[i] == ')') cnt[i]++;
	}
	int p = 0,lst = 0,sz = 0;
	for (int i = 0; i < g.size(); i++) {
		while (p < h.size() && h[p] < g[i]) p++;
		if (i - lst + 1 > h.size() - p) {
			if (i == lst || p == h.size()) break;
			else {
				sz++;
				int tot = i - lst;
				while (lst < i) t[sz].push_back(g[lst]),lst++;
				while (tot--) t[sz].push_back(h[p]),p++;
			}
		}
	}
	printf("%d\n",sz);
	for (int i = 1; i <= sz; i++) {
		printf("%d\n",t[i].size());
		for (auto it : t[i])
			printf("%d ",it);
		puts("");
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n,m,cnt[maxn];
char s[maxn];
vector<int> g,h;
vector<int> t;
int main() {
	scanf("%s",s + 1);
	n = strlen(s + 1);
	for (int i = 1; i <= n; i++)
		if (s[i] == '(') g.push_back(i);
		else h.push_back(i);
	for (int i = n - 1; i >= 0; i--) {
		cnt[i] += cnt[i + 1];
		if (s[i] == ')') cnt[i]++;
	}
	int l = 0,r = 0,sz = 0;
	bool f = true;
	for (int i = g.size() - 1; i >= 0; i--) {
		for (int j = 0; j < h.size(); j++) {
			if (h[j] > g[i] && h.size() - j >= i + 1) {
				sz++;
				for (int k = 0; k <= i; k++)
					t.push_back(g[k]),t.push_back(h.back()),h.pop_back();
				f = false;
				break;
			}
		}
		if (!f) break;
	}
	printf("%d\n",sz);
	if (sz) {
		printf("%d\n",t.size());
		sort(t.begin(),t.end());
		for (auto it : t)
			printf("%d ",it);
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n,m,cnt[maxn];
char s[maxn];
vector<int> g,h;
vector<int> t[maxn];
int main() {
	scanf("%s",s + 1);
	n = strlen(s + 1);
	for (int i = 1; i <= n; i++)
		if (s[i] == '(') g.push_back(i);
		else h.push_back(i);
	for (int i = n - 1; i >= 0; i--) {
		cnt[i] += cnt[i + 1];
		if (s[i] == ')') cnt[i]++;
	}
	int p = 0,lst = 0,sz = 0;
	for (int i = 0; i < g.size(); i++) {
		while (p < h.size() && h[p] < g[i]) p++;
		if (i - lst + 1 > h.size() - p) {
			if (i == lst || p == h.size()) break;
			else {
				sz++;
				int tot = i - lst;
				while (lst < i) t[sz].push_back(g[lst]),lst++;
				while (tot--) t[sz].push_back(h.back()),h.pop_back();
			}
		}
	}
	if (g.size() - lst <= h.size() - p) {
		if (lst != g.size() && p != h.size()) {
			sz++;
			int tot = g.size() - lst;
			while (lst < g.size()) t[sz].push_back(g[lst]),lst++;
			while (tot--) t[sz].push_back(h.back()),h.pop_back();
		}
	}
	printf("%d\n",sz);
	for (int i = 1; i <= sz; i++) {
		printf("%d\n",t[i].size());
		sort(t[i].begin(),t[i].end());
		for (auto it : t[i])
			printf("%d ",it);
		puts("");
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n,m,cnt[maxn];
char s[maxn];
vector<int> g,h;
vector<int> t[maxn];
int main() {
	scanf("%s",s + 1);
	n = strlen(s + 1);
	for (int i = 1; i <= n; i++)
		if (s[i] == '(') g.push_back(i);
		else h.push_back(i);
	for (int i = n - 1; i >= 0; i--) {
		cnt[i] += cnt[i + 1];
		if (s[i] == ')') cnt[i]++;
	}
	int p = 0,lst = 0,sz = 0;
	for (int i = 0; i < g.size(); i++) {
		while (p < h.size() && h[p] < g[i]) p++;
		if (i - lst + 1 > h.size() - p) {
			if (i == lst || p == h.size()) break;
			else {
				sz++;
				int tot = i - lst;
				while (lst < i) t[sz].push_back(g[lst]),lst++;
				while (tot--) t[sz].push_back(h[p]),p++;
			}
		}
	}
	if (lst != g.size() && p != h.size()) {
		sz++;
		int tot = g.size() - lst;
		while (lst < g.size()) t[sz].push_back(g[lst]),lst++;
		while (tot--) t[sz].push_back(h[p]),p++;
	}
	printf("%d\n",sz);
	for (int i = 1; i <= sz; i++) {
		printf("%d\n",t[i].size());
		for (auto it : t[i])
			printf("%d ",it);
		puts("");
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n,m,cnt[maxn];
char s[maxn];
vector<int> g,h;
vector<int> t[maxn];
int main() {
	scanf("%s",s + 1);
	n = strlen(s + 1);
	for (int i = 1; i <= n; i++)
		if (s[i] == '(') g.push_back(i);
		else h.push_back(i);
	for (int i = n - 1; i >= 0; i--) {
		cnt[i] += cnt[i + 1];
		if (s[i] == ')') cnt[i]++;
	}
	int p = 0,lst = 0,sz = 0;
	for (int i = 0; i < g.size(); i++) {
		while (p < h.size() && h[p] < g[i]) p++;
		if (i - lst + 1 > h.size() - p) {
			if (i == lst || p == h.size()) break;
			else {
				sz++;
				int tot = i - lst;
				while (lst < i) t[sz].push_back(g[lst]),lst++;
				while (tot--) t[sz].push_back(h[p]),p++;
			}
		}
	}
	if (g.size() - lst <= h.size() - p) {
		if (lst != g.size() && p != h.size()) {
			sz++;
			int tot = g.size() - lst;
			while (lst < g.size()) t[sz].push_back(g[lst]),lst++;
			while (tot--) t[sz].push_back(h[p]),p++;
		}
	}
	printf("%d\n",sz);
	for (int i = 1; i <= sz; i++) {
		printf("%d\n",t[i].size());
		for (auto it : t[i])
			printf("%d ",it);
		puts("");
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
long long n , t , f , ii , i , j, s ,aa[1000000],k  ;
string a ;
int main()
{

  cin>> a;
  n=a.size();
  j=n-1;
  for(i=0;i<n&&i<j;i++){
    if(a[i]=='('){
       while(a[j]!=')'&&j>i)j--;
       if(j==i)s=1;
       else{
       aa[k++]=i+1;
       aa[k++]=j+1;
       }
       j--;
    }
    if(s==1)break;
}
if(k==0)cout<<0;
else {
    cout<<1<<endl;
    cout<<k<<endl;
    for(i=0;i<k;i++)if(i%2==0)cout<<aa[i]<<" ";
     for(i=0;i<k;i++)if(i%2)cout<<aa[i]<<" ";
}
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
long long n , t , f , ii , i , j, s ,aa[1000000],k  ;
string a ;
int main()
{

  cin>> a;
  n=a.size();
  j=n-1;
  for(i=0;i<n&&i<j;i++){
    if(a[i]=='('){
       while(a[j]!=')'&&j>i)j--;
       if(j==i)s=1;
       else{
       aa[k++]=i+1;
       aa[k++]=j+1;
       }
       j--;
    }
    if(s==1)break;
}
if(k==0)cout<<0;
else {
    cout<<1<<endl;
    cout<<k<<endl;
    for(i=0;i<k;i++)if(i%2==0)cout<<aa[i]<<" ";
     for(i=k-1;i>0;i--)if(i%2)cout<<aa[i]<<" ";
}
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
long long n , t , f , ii , i , j, s ,aa[1000000],k  ;
string a ;
int main()
{

  cin>> a;
  n=a.size();
  j=n-1;
  for(i=0;i<n&&i<j;i++){
    if(a[i]=='('){
       while(a[j]!=')'&&j>i)j--;
       if(j==i)s=1;
       else{
       aa[k++]=i+1;
       aa[k++]=j+1;
       }
       j--;
    }
    if(s==1)break;
}
if(k==0)cout<<0;
else {
    cout<<1<<endl;
    cout<<k/2<<endl;
    for(i=0;i<k;i++)if(i%2==0)cout<<aa[i]<<" ";
     for(i=0;i<k;i++)if(i%2)cout<<aa[i]<<" ";
}
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
long long n , t , f , ii , i , j, s ,aa[1000000],k  ;
string a ;
int main()
{

  cin>> a;
  n=a.size();
  j=n-1;
  for(i=0;i<n&&i<j;i++){
    if(a[i]=='('){
       while(a[j]!=')'&&j>i)j--;
       if(j==i)s=1;
       else{
       aa[k++]=i+1;
       aa[k++]=j+1;
       }
       j--;
    }
    if(s==1)break;
}
if(k==0)cout<<0;
else {
    cout<<1<<endl;
    cout<<k<<endl;
    for(i=0;i<k;i++)if(i%2==0)cout<<aa[i]<<" ";
     for(i=k-1;i>0;i++)if(i%2)cout<<aa[i]<<" ";
}
    return 0;
}


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

set<int> ss;
vector<int> l,r;

int main()
{
    string s;
    cin>>s;
    int n = s.length();

    for(int i=0;i<n;i++){
        if(s[i]=='(')
            l.push_back(i);
        else r.push_back(i);
    }
    sort(l.begin(),l.end());
    sort(r.rbegin(),r.rend());

    int i=0,j=0;
    if(l.size()>0 and r.size()>0){
        while(l[i]<r[j]){
            i++;
            j++;
        }
    }
    else{
        cout<<0;
        return 0;
    }
    for(int ii =0;ii<i;ii++){
        ss.insert(l[ii]);
    }

    for(int ii =0;ii<j;ii++){
        ss.insert(r[ii]);
    }
    if(!ss.size()){
        cout<<0;
        return 0;
    }
    cout<<"1\n"<<ss.size()<<"\n";
    // if(ss.size()){
        for(int x:ss){
            cout<<x+1<<" ";
        }
    // }

}


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

int main()
{
    string s;
    cin>>s;
    int n = s.length();
    vector<int> l,r;
    for(int i=0;i<n;i++){
        if(s[i]=='(')
            l.push_back(i);
        else r.push_back(i);
    }
    sort(l.begin(),l.end());
    sort(r.rbegin(),r.rend());

    int i=0,j=0;
    if(l.size()>0 and r.size()>0){
    while(l[i]<r[j]){
        i++;
        j++;
    }
    }
    else{
        cout<<0;
        return 0;
    }

    set<int> ss;
    for(int ii =0;ii<i;ii++){
        ss.insert(l[ii]);
    }

    for(int ii =0;ii<j;ii++){
        ss.insert(r[ii]);
    }
    if(!ss.size()){
        cout<<0;
        return 0;
    }
    cout<<1<<"\n"<<ss.size()<<"\n";
    if(ss.size()){
        for(auto x:ss){
            cout<<x+1<<" ";
        }
    }

}


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

set<int> ss;
vector<int> l,r;

int main()
{
    string s;
    cin>>s;
    int n = s.length();

    for(int i=0;i<n;i++){
        if(s[i]=='(')
            l.push_back(i);
        else r.push_back(i);
    }
    sort(l.begin(),l.end());
    sort(r.rbegin(),r.rend());

    int i=0,j=0;
    if(l.size()>0 and r.size()>0){
        while(l[i]<r[j]){
            i++;
            j++;
        }
    }
    else{
        cout<<0;
        return 0;
    }
Z
    for(int ii =0;ii<i;ii++){
        ss.insert(l[ii]);
    }

    for(int ii =0;ii<j;ii++){
        ss.insert(r[ii]);
    }
    if(!ss.size()){
        cout<<0;
        return 0;
    }
    cout<<"1\n"<<ss.size()<<"\n";
    // if(ss.size()){
        for(int x:ss){
            cout<<x+1<<" ";
        }
    // }

}