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

using namespace std;

int main()
{
    // var
    int n, temp_X, temp_Y, counter;
    vector<int> X_Coord;
    vector<int> Y_Coord;
    int xi, xj, xk, yi, yj, yk;

    // input
    cin >> n;
    for (int i=0; i<n; i++)
    {
        scanf("%d%d/n", &temp_X, &temp_Y);
        //cin >> temp_X >> temp_Y;
        X_Coord.push_back(temp_X);
        Y_Coord.push_back(temp_Y);
    }

    // check points
    counter = 0;
    for (int i=0; i<n-2; i++)
    {
        xi = X_Coord[i];
        yi = Y_Coord[i];
        for (int j=i+1; j<n-1; j++)
        {
            xj = X_Coord[j];
            yj = Y_Coord[j];
            for (int k=j+1; k<n; k++)
            {
                xk = X_Coord[k];
                yk = Y_Coord[k];
                if (xi + xk == 2 * xj && yi + yk == 2 * yj)
                {
                    counter++;
                    break;
                }
                if (xi + xj == 2 * xk && yi + yj == 2 * yk)
                {
                    counter++;
                    break;
                }
                if (xj + xk == 2 * xi && yj + yk == 2 * yi)
                {
                    counter++;
                    break;
                }
            }
        }
    }

    cout << counter << endl;

    return 0;

}


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

using namespace std;

int main()
{
    // var
    int n, temp_X, temp_Y, counter;
    vector<int> X_Coord;
    vector<int> Y_Coord;
    int xi, xj, xk, yi, yj, yk;

    // input
    cin >> n;
    for (int i=0; i<n; i++)
    {
        scanf("%d%d/n", &temp_X, &temp_Y);
        //cin >> temp_X >> temp_Y;
        X_Coord.push_back(temp_X);
        Y_Coord.push_back(temp_Y);
    }

    // check points
    counter = 0;
    for (int i=0; i<n-2; i++)
    {
        xi = X_Coord[i];
        yi = Y_Coord[i];
        for (int j=i+1; j<n-1; j++)
        {
            xj = X_Coord[j];
            yj = Y_Coord[j];
            for (int k=j+1; k<n; k++)
            {
                xk = X_Coord[k];
                yk = Y_Coord[k];
                if (xi + xk == 2 * xj && yi + yk == 2 * yj)
                {
                    counter++;
                }
                if (xi + xj == 2 * xk && yi + yj == 2 * yk)
                {
                    counter++;
                }
                if (xj + xk == 2 * xi && yj + yk == 2 * yi)
                {
                    counter++;
                }
            }
        }
    }

    cout << counter << endl;

    return 0;

}


#include <iostream>
#include <vector>

using namespace std;

int main()
{
    // var
    int n, temp_X, temp_Y, counter;
    vector<int> X_Coord;
    vector<int> Y_Coord;

    // input
    cin >> n;
    for (int i=0; i<n; i++)
    {
        cin >> temp_X >> temp_Y;
        X_Coord.push_back(temp_X);
        Y_Coord.push_back(temp_Y);
    }

    // sort points by x coordinate, then by y coordinate
    for (int i=0; i<n; i++)
    {
        for (int j=0; j<n-1; j++)
        {
            if (X_Coord[j] > X_Coord[j+1] || (X_Coord[j] == X_Coord[j+1] && Y_Coord[j] > Y_Coord[j+1]))
            {
                temp_X = X_Coord[j];
                X_Coord[j] = X_Coord[j+1];
                X_Coord[j+1] = temp_X;

                temp_Y = Y_Coord[j];
                Y_Coord[j] = Y_Coord[j+1];
                Y_Coord[j+1] = temp_Y;
            }
        }
    }

    // check points
    counter = 0;
    for (int i=0; i<n-2; i++)
    {
        for (int j=i+1; j<n-1; j++)
        {
            for (int k=j+1; k<n; k++)
            {
                if (X_Coord[i] + X_Coord[k] == 2 * X_Coord[j] && Y_Coord[i] + Y_Coord[k] == 2 * Y_Coord[j])
                {
                    counter++;
                }
            }
        }
    }

    cout << counter << endl;

    return 0;

}


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

using namespace std;

int main()
{
    // var
    int n, temp_X, temp_Y, counter;
    vector<int> X_Coord;
    vector<int> Y_Coord;
    int xi, xj, xk, yi, yj, yk;
    int SolutionFound;

    // input
    cin >> n;
    for (int i=0; i<n; i++)
    {
        scanf("%d%d/n", &temp_X, &temp_Y);
        //cin >> temp_X >> temp_Y;
        X_Coord.push_back(temp_X);
        Y_Coord.push_back(temp_Y);
    }

    // check points
    counter = 0;
    for (int i=0; i<n-2; i++)
    {
        xi = X_Coord[i];
        yi = Y_Coord[i];
        for (int j=i+1; j<n-1; j++)
        {
            SolutionFound = 0;
            xj = X_Coord[j];
            yj = Y_Coord[j];
            for (int k=j+1; k<n && SolutionFound == 0; k++)
            {
                xk = X_Coord[k];
                yk = Y_Coord[k];
                if (xi + xk == 2 * xj && yi + yk == 2 * yj)
                {
                    counter++;
                    SolutionFound++;
                    break;
                }
                if (xi + xj == 2 * xk && yi + yj == 2 * yk)
                {
                    counter++;
                    SolutionFound++;
                    break;
                }
                if (xj + xk == 2 * xi && yj + yk == 2 * yi)
                {
                    counter++;
                    SolutionFound++;
                    break;
                }
            }
        }
    }

    cout << counter << endl;

    return 0;

}


#include <iostream>
#include <fstream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

#define EPS 1e-9
#define INF MOD
#define MOD 1000000007LL
#define fir first
#define iss istringstream
#define sst stringstream
#define ite iterator
#define ll long long
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pi pair<int,int>
#define pb push_back
#define sec second
#define sh(i) (1LL<<i)
#define sz size()
#define vi vector<int>
#define vc vector
#define vl vector<ll>
#define vs vector<string>

int n,x[3010],y[3010],c[4010][4010];

int main(){
	cin>>n;
	rep(i,n){
		cin>>x[i]>>y[i];
		x[i]*=2,y[i]*=2;
		c[x[i]+2000][y[i]+2000]=1;
	}
	int ans=0;
	rep(i,n)rep2(j,i+1,n){
		if(c[(x[i]+x[j])/2+2000][(y[i]+y[j])/2+2000])ans++;
	}
	cout<<ans;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <set>
#include <vector>

using namespace std;

bool Equal(double a, double b){
	return  abs(a - b) < 1e-9;
}

bool used[3000][3000];

vector<pair<int, int>> vP;
set<pair<int, int>> sP;

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

	int n;
	scanf("%d", &n);

	for (int i = 0; i < n; i++){
		int a, b;
		scanf("%d%d", &a, &b);
		vP.push_back(make_pair(a + 1100, b + 1100));
		used[a + 1100][b + 1100] = true;
	}

	int count = 0;

	for (int i = 0; i < n; i++)
	for (int j = 0; j < n; j++){
		if (i == j)
			continue;
		double midA = ((double)vP[i].first + vP[j].first) / 2;
		double midB = ((double)vP[i].second + vP[j].second) / 2;
		if (!Equal((int)midA, midA) || !Equal((int)midB, midB))
			continue;
		int a = (int)midA;
		int b = (int)midB;
		if (used[a][b])
			count++;
	}

	printf("%d", count / 2);

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <set>
#include <vector>

using namespace std;

bool Equal(double a, double b){
	return  abs(a - b) < 1e-9;
}

bool used[3000][3000];

vector<pair<int, int>> vP;
set<pair<int, int>> sP;

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

	int n;
	scanf("%d", &n);

	for (int i = 0; i < n; i++){
		int a, b;
		scanf("%d%d", &a, &b);
		vP.push_back(make_pair(a, b));
		used[a + 1100][b + 1100] = true;
	}

	int count = 0;

	for (int i = 0; i < n; i++)
	for (int j = 0; j < n; j++){
		if (i == j)
			continue;
		double midA = ((double)vP[i].first + vP[j].first) / 2;
		double midB = ((double)vP[i].second + vP[j].second) / 2;
		if (!Equal((int)midA, midA) || !Equal((int)midB, midB))
			continue;
		int a = (int)midA;
		int b = (int)midB;
		if (used[a - 1100][b - 1100])
			count++;
	}

	printf("%d", count / 2);

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <set>
#include <vector>

using namespace std;

bool Equal(double a, double b){
	return  abs(a - b) < 1e-9;
}

vector<pair<int, int>> vP;
set<pair<int, int>> sP;

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

	int n;
	scanf("%d", &n);

	for (int i = 0; i < n; i++){
		int a, b;
		scanf("%d%d", &a, &b);
		vP.push_back(make_pair(a, b));
		sP.insert(make_pair(a, b));
	}

	int count = 0;

	for (int i = 0; i < n; i++)
	for (int j = 0; j < n; j++){
		if (i == j)
			continue;
		double midA = ((double)vP[i].first + vP[j].first) / 2;
		double midB = ((double)vP[i].second + vP[j].second) / 2;
		if (!Equal((int)midA, midA) || !Equal((int)midB, midB))
			continue;
		if (sP.count(make_pair((int)midA, (int)midB)))
			count++;
	}

	printf("%d", count / 2);

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <vector>
#include <set>

using namespace std;

vector<pair<int, int>> pV;
set<pair<int, int>> pS;

int Round(double a){
	return (int)(a + 0.5);
}

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

	for (int i = 0; i < n; i++){
		int a, b;
		scanf("%d%d", &a, &b);
		pair<int, int> p = make_pair(a, b);
		pV.push_back(p);
		pS.insert(p);
	}

	int count = 0;

	for (int i = 0; i < n; i++){
		for (int j = 0; j < n; j++){
			if (i == j)
				continue;
			int midA = Round((double) (pV[i].first + pV[j].first) / 2);
			int midB = Round((double) (pV[i].second + pV[j].second) / 2);
			if (pS.count(make_pair(midA, midB)) > 0)
				count++;
		}
	}

	printf("%d", count);

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <vector>
#include <set>

using namespace std;

vector<pair<int, int>> pV;
set<pair<int, int>> pS;

int Round(double a){
	return (int)(a + 0.5);
}

bool Equal(double a, double b){
	return abs(a - b) < 1e-9;
}

bool IsCel(double a){
	return Equal(Round(a), a);
}

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

	int n;
	scanf("%d", &n);

	for (int i = 0; i < n; i++){
		int a, b;
		scanf("%d%d", &a, &b);
		pair<int, int> p = make_pair(a, b);
		pV.push_back(p);
		pS.insert(p);
	}

	int count = 0;

	for (int i = 0; i < n; i++){
		for (int j = 0; j < n; j++){
			if (i == j)
				continue;
			int c, d;
			double midA = ((double) pV[i].first + pV[j].first) / 2;
			double midB = ((double) pV[i].second + pV[j].second) / 2;
			if (IsCel(midA) && IsCel(midB)){
				c = Round(midA);
				d = Round(midB);
			}
			else
				continue;
			if (pS.count(make_pair(c, d)) > 0)
				count++;
		}
	}

	printf("%d", count / 2);

	return 0;
}


#include <iostream>
//#include <string>
//#include <math.h>
//#include <vector.h>
//#include <string>
//typedef long long ll;
using namespace std;

int main()
{
    int n,m;
    int x[3001],y[3001],c=0;
    bool **b=new bool*[7002];
    for (int i=0;i<7002;i++)
    {
        b[i]=new bool[7002];
        for (int j=0;j<7002;j++)
            b[i][j]=false;
    }

    cin>>n;
    for (int i=0;i<n;i++)
    {
        cin>>x[i]>>y[i];
        b[3000+x[i]][3000+y[i]]=true;
    }
    for (int i=1;i<n;i++)
        for (int j=0;j<i;j++)
        {
            if (b[3000+2*x[i]-x[j]][3000+2*y[i]-y[j]]) c++;
            if (b[3000+2*x[j]-x[i]][3000+2*y[j]-y[i]]) c++;
        }
    cout<<c/2;
   // system("Pause");
    return 0;

}


#include <iostream>
//#include <string>
//#include <math.h>
//#include <vector.h>
//#include <string>
//typedef long long ll;
using namespace std;

int main()
{
    int n,m;
    int x[3001],y[3001],c=0;
    bool **b=new bool*[4002];
    for (int i=0;i<4002;i++)
    {
        b[i]=new bool[4002];
        for (int j=0;j<4002;j++)
            b[i][j]=false;
    }

    cin>>n;
    for (int i=0;i<n;i++)
    {
        cin>>x[i]>>y[i];
        b[1000+x[i]][1000+y[i]]=true;
    }
    for (int i=1;i<n;i++)
        for (int j=0;j<i;j++)
            if (b[1000+2*x[i]-x[j]][1000+2*y[i]-y[j]]) c++;
    cout<<c;
    return 0;

}


#include <iostream>
//#include <string>
//#include <math.h>
//#include <vector.h>
//#include <string>
//typedef long long ll;
using namespace std;

int main()
{
    int n,m;
    int x[3001],y[3001],c=0;
    cin>>n;
    for (int i=0;i<n;i++)
        cin>>x[i]>>y[i];
    for (int i=1;i<n;i++)
        for (int j=0;j<i;j++)
            for (int k=0;k<n;k++)
                if (x[i]+x[j]==2*x[k] && y[i]+y[j]==2*y[k]) c++;
    cout<<c;
    return 0;

}


#include <iostream>
//#include <string>
//#include <math.h>
//#include <vector.h>
//#include <string>
//typedef long long ll;
using namespace std;

int main()
{
    int n,m;
    int x[3001],y[3001],c=0;
    bool **b=new bool*[4002];
    for (int i=0;i<4002;i++)
    {
        b[i]=new bool[4002];
        for (int j=0;j<4002;j++)
            b[i][j]=false;
    }

    cin>>n;
    for (int i=0;i<n;i++)
    {
        cin>>x[i]>>y[i];
        b[1000+x[i]][1000+y[i]]=true;
    }
    for (int i=1;i<n;i++)
        for (int j=0;j<i;j++)
        {
            if (b[1000+2*x[i]-x[j]][1000+2*y[i]-y[j]]) c++;
            if (b[1000+2*x[j]-x[i]][1000+2*y[j]-y[i]]) c++;
        }
    cout<<c/2;
    //system("Pause");
    return 0;

}


#include <iostream>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>

using namespace std;

#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)((a).size())
#define X first
#define Y second
#define sqr(x) (x) * (x)
#define y1 __y1
#define endl '\n'

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

const int INF = (int)(1e9);
const li INF64 = (li)(INF) * (li)(INF);
const ld eps = 1e-9;
const ld PI = (ld)(3.1415926535897932384626433832795);

const int dx[] = {-1, -1, 0, 1, 1, 1, 0, -1};
const int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};

bool in(int i, int j, int n, int m)
{
    return i >= 0 && i < n && j >= 0 && j < m;
}

inline int myrand()
{
    return rand() ^ (rand() << 15);
}

const int N = 3333;

set<pt> was;
pt a[N];
int n;

int main(){
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    cout << setprecision(12) << fixed;
    cerr << setprecision(10) << fixed;

    srand(int(time(NULL)));

    cin >> n;
    forn(i, n)
    {
        cin >> a[i].X >> a[i].Y;
        was.insert(a[i]);
    }

    sort(a, a + n);

    int ans = 0;

    forn(i, n)
    {
        for(int j = i + 1; j < n; j++)
        {
            int needX = a[i].X + a[j].X;
            int needY = a[i].Y + a[j].Y;

            if(needX % 2 || needY % 2)
                continue;
            needX /= 2;
            needY /= 2;
            ans += was.find(mp(needX, needY)) != was.end();
        }
    }

    cout << ans << endl;

    return 0;
}


#include <fstream>
#include <iostream>
#include <vector>
#include <map>

using namespace std;

//ifstream cin ("input.txt"); ofstream cout ("output.txt");

int main () {
	int n;
	cin >> n;
	vector <pair <int ,int> > v;
	int a , b;
	map < int , map <int , bool> > mp;
	for (int i = 0; i < n; ++i) {
		cin >> a >> b;
		v.push_back (make_pair (a , b));
		mp[a * 2][b * 2] = true;
	}

	int res = 0;
	for (int i = 0; i < n; ++i) {
		for (int  j = i + 1; j < n; ++j) {
			if (mp[v[i].first + v[j].first][v[i].second + v[j].second]) {
				++res;
			}
		}
	}
	cout << res;
}


#include <fstream>
#include <iostream>
#include <vector>
#include <set>
#include <map>

using namespace std;

//ifstream cin ("input.txt"); ofstream cout ("output.txt");

int main () {
	int n;
	cin >> n;
	vector <pair <int ,int> > v;
	int a , b;
	set <pair <int , int> > st;
	for (int i = 0; i < n; ++i) {
		cin >> a >> b;
		v.push_back (make_pair (a , b));
		st.insert (make_pair (2 * a , 2 * b));
	}

	int res = 0;
	for (int i = 0; i < n; ++i) {
		for (int  j = i + 1; j < n; ++j) {
			if (st.find (make_pair (v[i].first + v[j].first , v[i].second + v[j].second)) != st.end() ) {
				++res;
			}
		}
	}
	cout << res;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <string>
#include <algorithm>
using namespace std;

typedef long long int ll;

vector<pair<int, int> > v;
pair<int, int> x;

bool find(int i, int j) {
	if (i > j)
		return false;

	int m = (i + j) / 2;
	if (v[m] == x)
		return true;
	else if ((v[m].first < x.first) || (v[m].first == x.first && v[m].second < x.second))
		return find(m+1, j);
	else
		return find(i, m-1);
}

int main()
{
	//freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout);
	string line;
	int n, a, b, count = 0;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a >> b;
		v.push_back(make_pair(a, b));
	}

	sort(v.begin(), v.end());
	for (int i = 0; i < n - 1; i++) {
		for (int j = i + 1; j < n; j++) {
			int a = (v[i].first + v[j].first);
			int b = (v[i].second + v[j].second);
			if ((a % 2 == 0) && (b % 2 == 0))
			{
				x.first =  a / 2;
				x.second = b / 2;
				if (find(0, n-1))
					count++;
			}
		}
	}
	cout << count;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <set>
#include <vector>
#include <queue>
#include <string>
#include <vector>
#include <bitset>
#include <map>
using namespace std;
#define N 200000
#define inf 0x7fffffff
#define eps 1e-8
#define ll long long
#define zero(x) memset(x,0,sizeof(x))
#define Negone(x) memset(x,-1,sizeof(x))
const double PI=acos(-1.0);
//------------------------------分割线-------------------------------

bool fl[2001][2001];
struct Point{
    int x,y;
    void read(){
        cin>>x>>y;
        x+=1000;
        y+=1000;
        fl[x][y]=1;
    }
}p[3001];
int main(){
    int n;
    while(cin>>n){
        zero(fl);
        for(int i=1;i<=n;++i){
            p[i].read();
        }
        int ans=0;
        for(int i=1;i<=n;++i){
            for(int j=i+1;j<=n;++j){
                int sx=(p[i].x+p[j].x),sy=(p[i].y+p[j].y);
                if(sx%2==0 && sy%2==0){
                    if(fl[sx/2][sy/2]) ans++;
                }
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
#include<math.h>
#include<queue>
#include<stack>
#include<sstream>
#include<stdio.h>
#include<map>
#include<set>
#include<memory.h>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b){
    if (!b)
        return a;
    return gcd(b, a%b);
}
ll lcm(ll a, ll b){
    return b / gcd(a, b)*a;
}
#define FOR(I,N) for(int(i)=0;i<int(N);++i)
#define FORK(I,N,K) for(int(i)=0;i<int(N);i+=int(K))

int n;
pair<int, int> g[3000];
int res;
int main(){
    cin >> n;
    FOR(0, n)
        cin >> g[i].first >> g[i].second;
    sort(g, g + n);
    FOR(0, n){
        for (int j = i + 1; j < n; ++j){
            if ((g[i].first + g[j].first) & 1 || (g[i].second + g[j].second) & 1)
                continue;
            pair<int, int> r((g[i].first + g[j].first) / 2, (g[i].second + g[j].second) / 2);
            if (r != g[i] && r != g[j] && binary_search(g, g + n, r))
                ++res;
        }
    }
    cout << res << endl;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
using namespace std;
struct node
{
    int x,y;
}a[3005];
bool cmp(node a,node b)
{
    return a.x<b.x;
}
int main()
{
    int n,i,j,k,ans=0;
    scanf("%d",&n);
    for(i=0;i<n;++i)
        scanf("%d%d",&a[i].x,&a[i].y);
    sort(a,a+n,cmp);
    for(i=0;i<n;++i)
        for(j=i+2;j<n;++j)
            for(k=i+1;k<j;++k)
                if(((a[i].x+a[j].x)&1)==0&&((a[i].y+a[j].y)&1)==0&&((a[i].x+a[j].x)>>1)==a[k].x&&((a[i].y+a[j].y)>>1)==a[k].y)
                    ++ans;
    printf("%d\n",ans);
    return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
using namespace std;
struct node
{
    int x,y;
}a[3005];
bool cmp(node a,node b)
{
    if(a.x==b.x)
        return a.y<b.y;
    return a.x<b.x;
}
int main()
{
    int n,i,j,k,ans=0;
    scanf("%d",&n);
    for(i=0;i<n;++i)
        scanf("%d%d",&a[i].x,&a[i].y);
    sort(a,a+n,cmp);
    for(i=0;i<n;++i)
        for(j=i+2;j<n;++j)
            for(k=i+1;k<j;++k)
                if(((a[i].x+a[j].x)&1)==0&&((a[i].y+a[j].y)&1)==0&&((a[i].x+a[j].x)>>1)==a[k].x&&((a[i].y+a[j].y)>>1)==a[k].y)
                    ++ans;
    printf("%d\n",ans);
    return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
using namespace std;
int h[5000][5000];
struct node
{
    int x,y;
}a[3005];
bool cmp(node a,node b)
{
    if(a.x==b.x)
        return a.y<b.y;
    return a.x<b.x;
}
int main()
{
    int n,i,j,ans=0;
    scanf("%d",&n);
    for(i=0;i<n;++i)
        scanf("%d%d",&a[i].x,&a[i].y);
    sort(a,a+n,cmp);
    for(i=0;i<n;++i)
        for(j=i+2;j<n;++j)
            if(((a[i].x+a[j].x)&1)==0&&((a[i].y+a[j].y)&1)==0)
                ++h[((a[i].x+a[j].x)>>1)+2020][((a[i].y+a[j].y)>>1)+2020];
    for(i=0;i<n;++i)
        ans+=h[a[i].x+2020][a[i].y+2020];
    printf("%d\n",ans);
    return 0;
}


#include <stdio.h>
#include <conio.h>

void main() {
    int countCoords, arrCoords[2][3000], nowCoords[2][2], center[2], countSol = 0;
    scanf("%d", &countCoords);
    for(int i = 0; i < countCoords; i++)
        scanf("%d %d", &arrCoords[0][i], &arrCoords[1][i]);
    for(int i = 0; i < countCoords; i++) {
        nowCoords[0][0] = arrCoords[0][i];
        nowCoords[0][1] = arrCoords[1][i];
        for(int j = i + 1; j < countCoords; j++) {
            nowCoords[1][0] = arrCoords[0][j];
            nowCoords[1][1] = arrCoords[1][j];
            if(((nowCoords[0][0] + nowCoords[1][0]) % 2 == 0)&&(nowCoords[0][1] + nowCoords[1][1]) % 2 == 0) {
                center[0] = (nowCoords[0][0] + nowCoords[1][0]) / 2;
                center[1] = (nowCoords[0][1] + nowCoords[1][1]) / 2;
            } else continue;
            for(int k = 0; k < countCoords; k++) {
                if((arrCoords[0][k] == center[0])&&(arrCoords[1][k] == center[1]))
                    countSol++;
            }
        }
    }
    printf( "%d", countSol);
}


#include <stdio.h>
bool map[2005][2005];
void main() {
    int countCoords, arrCoords[2][3000], nowCoords[2][2], center[2], countSol = 0;
    scanf("%d", &countCoords);
    for(int i = 0; i < countCoords; i++) {
        scanf("%d %d", &arrCoords[0][i], &arrCoords[1][i]);
        map[1000 + arrCoords[0][i]][1000 + arrCoords[1][i]] = true;
    }
    for(int i = 0; i < countCoords; i++)
        for(int j = i + 1; j < countCoords; j++)
            if((((arrCoords[0][i] + arrCoords[0][j]) % 2 == 0)&&(arrCoords[1][i] + arrCoords[1][j]) % 2 == 0)&&(map[(arrCoords[0][i]+arrCoords[0][j])/2+1000][(arrCoords[1][i]+arrCoords[1][j])/2+1000]))
                countSol++;
    printf("%d", countSol);
}


#include <stdio.h>
#include <conio.h>

void main() {
    FILE *Fin = fopen("input.txt", "r"), *Fout = fopen("output.txt", "w");
    int countCoords, arrCoords[2][3000], nowCoords[2][2], center[2], countSol = 0;
    fscanf(Fin, "%d", &countCoords);
    for(int i = 0; i < countCoords; i++)
        fscanf(Fin, "%d %d", &arrCoords[0][i], &arrCoords[1][i]);
    for(int i = 0; i < countCoords; i++) {
        nowCoords[0][0] = arrCoords[0][i];
        nowCoords[0][1] = arrCoords[1][i];
        for(int j = i + 1; j < countCoords; j++) {
            nowCoords[1][0] = arrCoords[0][j];
            nowCoords[1][1] = arrCoords[1][j];
            if(((nowCoords[0][0] + nowCoords[1][0]) % 2 == 0)&&(nowCoords[0][1] + nowCoords[1][1]) % 2 == 0) {
                center[0] = (nowCoords[0][0] + nowCoords[1][0]) / 2;
                center[1] = (nowCoords[0][1] + nowCoords[1][1]) / 2;
            } else continue;
            for(int k = 0; k < countCoords; k++) {
                if((arrCoords[0][k] == center[0])&&(arrCoords[1][k] == center[1]))
                    countSol++;
            }
        }
    }
    fprintf(Fout, "%d", countSol);
}


#include <stdio.h>
#include <conio.h>

void main() {
	FILE *Fin = fopen("input.txt", "r");//, *Fout = fopen("output.txt", "w");
	int countCoords, arrCoords[2][3000], nowCoords[2][2], center[2], countSol = 0;
	fscanf(Fin, "%d", &countCoords);
	for(int i = 0; i < countCoords; i++)
		fscanf(Fin, "%d %d", &arrCoords[0][i], &arrCoords[1][i]);
	for(int i = 0; i < countCoords; i++) {
		nowCoords[0][0] = arrCoords[0][i];
		nowCoords[0][1] = arrCoords[1][i];
		for(int j = i + 1; j < countCoords; j++) {
			nowCoords[1][0] = arrCoords[0][j];
			nowCoords[1][1] = arrCoords[1][j];
			if(((nowCoords[0][0] + nowCoords[1][0]) % 2 == 0)&&(nowCoords[0][1] + nowCoords[1][1]) % 2 == 0) {
				center[0] = (nowCoords[0][0] + nowCoords[1][0]) / 2;
				center[1] = (nowCoords[0][1] + nowCoords[1][1]) / 2;
			} else continue;
			for(int k = 0; k < countCoords; k++) {
				if((arrCoords[0][k] == center[0])&&(arrCoords[1][k] == center[1])) countSol++;
			}
		}
	}
	printf("%d", countSol);
	getch();
}


#include <iostream>
#include <vector>
#include <cmath>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<vector<bool> > B(2001, 2001);
    vector<pair<int, int> > v(n);
    for(int i = 0; i < n; i++)
    {
        cin >> v[i].first >> v[i].second;
        B[v[i].first + 1000][v[i].second + 1000] = true;
    }
    sort(v.begin(), v.end());
    int count = 0;
    for(int i = 0; i < n; i++)
    {
        for(int j = i + 1; j < n; j++)
        {
            int x = 2 * v[j].first - v[i].first, y = 2 * v[j].second - v[i].second;
            if(-1000 <= x && x <= 1000 && -1000 <= y && y <= 10000)
            {
                if(B[x + 1000][y + 1000])
                {
                    count++;
                }
            }
        }
    }
    cout << count << endl;
    return 0;
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace contest
{
    class Program
    {
        static void Main(string[] args)
        {
            Int64 a = Int64.Parse(Console.ReadLine());
            if (a == 0)
            {
                Console.WriteLine("1");
            }
            else
            {
                int result = 0;
                while (a != 0)
                {
                    result++; ;
                    a /= 10;
                }
                Console.WriteLine(result);
            }
        }
    }
}


#include <iostream>
#include <vector>
#include <cmath>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<vector<bool> > B(2001, 2001);
    vector<pair<int, int> > v(n);
    for(int i = 0; i < n; i++)
    {
        cin >> v[i].first >> v[i].second;
        B[v[i].first + 1000][v[i].second + 1000] = true;
    }
    sort(v.begin(), v.end());
    int count = 0;
    for(int i = 0; i < n; i++)
    {
        for(int j = i + 1; j < n; j++)
        {
            int x = 2 * v[j].first - v[i].first, y = 2 * v[j].second - v[i].second;
            if(-1000 <= x && x <= 1000 && -1000 <= y && y <= 1000)
            {
                if(B[x + 1000][y + 1000])
                {
                    count++;
                }
            }
        }
    }
    cout << count << endl;
    return 0;
}


#include <iostream>
using namespace std;

void main()
{
	unsigned long long int kol=0;
	int f,f1,f2,f3,n; cin >> n;
	int *x=new int [n];
	int *y=new int [n];
	for(f=0;f<n;f++) cin >>x[f]>>y[f];
	for(f=0;f<n;f++)
	{
		for(f1=f+1;f1<n;f1++)
		{
			if(f==f1) continue;
			for(f2=0;f2<n;f2++)
			{
				if((f2==f1)||(f2==f)) continue;
				if((2*x[f2]==((x[f1]+x[f])))&&(2*y[f2]==((y[f1]+y[f]))))
				{kol++;break;}
			}
		}
	}
	cout<<kol;
//	system("pause");
}


#include <iostream>
using namespace std;

void search(int *x,int *y,int l,int r,unsigned long long int &kol,int x1,int y1)
{
	int m;
	while(l-r>1)
	{
		m=(l+r)/2;
		if (2*x[m]>x1) r=m;
		if (2*x[m]<x1) l=m;
		if (2*x[m]==x1)
		{
			if(2*y[m]>y1) r=m;
			if(2*y[m]>y1) l=m;
			if(2*x[m]==y1) {kol++;return;}
		}
	}
	m=l;
	if (2*x[m]==x1)
	{
		if(2*x[m]==y1) {kol++;return;}
	}
	m=r;
	if (2*x[m]==x1)
	{
		if(2*x[m]==y1) {kol++;return;}
	}
	return;
}

void main()
{
	unsigned long long int kol=0;
	int f,f1,f2,f3,n; cin >> n;
	int *x=new int [n];
	int *y=new int [n];
	for(f=0;f<n;f++) cin >>x[f]>>y[f];
	for(f=0;f<n;f++)
	{
		for(f1=0;f1<n;f1++)
		{
			if(x[f]>x[f1])
			{
				f2=x[f];
				x[f]=x[f1];
				x[f1]=f2;
				f2=y[f];
				y[f]=y[f1];
				y[f1]=f2;
			}
			if ((x[f]==x[f1])&&(y[f]>y[f1]))
			{
				f2=x[f];
				x[f]=x[f1];
				x[f1]=f2;
				f2=y[f];
				y[f]=y[f1];
				y[f1]=f2;
			}
		}
	}
	for(f=0;f<n;f++)
	{
		for(f1=f+1;f1<n;f1++)
		{
			if(f==f1) continue;
			search(x,y,f+1,f1-1,kol,x[f]+x[f1],y[f]+y[f1]);
		}
	}
	cout<<kol;
//	system("pause");
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    //scanf("%d",&n);
   // printf("%d\n",n);

    int na[100004];
    int nb[100004];
    int k,m,a,b;
    cin>>a>>b;
    cin>>k>>m;
    for(int i=1;i<=a;i++)cin>>na[i];
    for(int i=1;i<=b;i++)cin>>nb[i];

        if(na[k]<nb[b-m+1])
            cout<<"YES"<<endl;
            else
            cout<<"NO"<<endl;

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    //scanf("%d",&n);
   // printf("%d\n",n);

    int na[100004];
    int nb[100004];
    int k,m,a,b;
    cin>>a>>b;
    cin>>k>>m;
    for(int i=1;i<=a;i++)cin>>na[i];
    for(int i=1;i<=b;i++)cin>>nb[i];

        if(na[k]<nb[b-m])
            cout<<"YES"<<endl;
            else
            cout<<"NO"<<endl;

    return 0;
}


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

int main()
{
    int n,t;

    cin >>n>>t;
    int ara[n],ara1[t];

    int k,m;
    cin >>k>>m;

    int i=0;
    for(i=0;i<n;i++)
    {
        cin >>ara[i];
    }
    for(i=0;i<t;i++)
    {
        cin >>ara1[i];
    }
    sort(ara,ara+n);
    sort(ara1,ara1+t);
    if(ara[k-1]<ara1[0]) printf("YES\n");

    else printf("NO\n");

    return 0;
}


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

int main()
{
    int n,t;

    cin >>n>>t;
    long int ara[n],ara1[t];

    int k,m;

    cin >>k>>m;

    int i=0;
    for(i=0;i<n;i++)
    {
        cin >>ara[i];
    }
    for(i=0;i<t;i++)
    {
        cin >>ara1[i];
    }
    if(ara1[0]>ara[k-1]) printf("YES\n");

     else cout <<"NO\n";

    return 0;
}


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

int main()
{
    int n,t;

    cin >>n>>t;
    long int ara[n],ara1[t];

    int k,m;
    cin >>k>>m;

    int i=0;
    for(i=0;i<n;i++)
    {
        cin >>ara[i];
    }
    for(i=0;i<t;i++)
    {
        cin >>ara1[i];
    }
    sort(ara,ara+n);
    sort(ara1,ara1+t);
    if(ara[k-1]<ara1[0]) printf("YES\n");

    else printf("NO\n");

    return 0;
}


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

int main()
{
    int n,t;

    cin >>n>>t;
    int ara[n],ara1[t];

    int k,m;
    cin >>k>>m;

    int i=0;
    for(i=0;i<n;i++)
    {
        cin >>ara[i];
    }
    for(i=0;i<t;i++)
    {
        cin >>ara1[i];
    }
    sort(ara,ara+n);
    sort(ara1,ara1+t);
    if(ara[k-1]<ara1[m-1]) printf("YES\n");

    else printf("NO\n");

    return 0;
}


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

int main()
{
    int n,t;

    cin >>n>>t;
    long int ara[n],ara1[t];

    int k,m;
    cin >>k>>m;

    int i=0;
    for(i=0;i<n;i++)
    {
        cin >>ara[i];
    }
    for(i=0;i<t;i++)
    {
        cin >>ara1[i];
    }

    for(int i=0;i<m;i++)
    {
        if(ara[k-1]<ara1[i])
        {
            continue;
        }
        else
        {
            printf("NO\n");
            return 0;
        }
    }
     if (i==m)printf("YES\n");
     else cout <<"NO\n";

    return 0;
}


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

int main()
{
    int n,t;

    cin >>n>>t;
    long int ara[n],ara1[t];

    int k,m;

    cin >>k>>m;

    int i=0;
    for(i=0;i<n;i++)
    {
        cin >>ara[i];
    }
    for(i=0;i<t;i++)
    {
        cin >>ara1[i];
    }
    if(ara[k-1]<ara1[m-1]) printf("YES\n");

     else cout <<"NO\n";

    return 0;
}


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

int main()
{
    int n,t;

    cin >>n>>t;
    long int ara[n],ara1[t];

    int k,m;
    cin >>k>>m;

    int i=0;
    for(i=0;i<n;i++)
    {
        cin >>ara[i];
    }
    for(i=0;i<t;i++)
    {
        cin >>ara1[i];
    }

    for(int i=0;i<m;i++)
    {
        if(ara[k-1]<ara1[i])
        {
            continue;
        }
        else {printf("NO\n");
        return 0;
        }
    }
    printf("YES\n");

    return 0;
}


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

int main()
{
    int n,t;

    cin >>n>>t;
    long int ara[n],ara1[t];

    int k,m;
    cin >>k>>m;

    int i=0;
    for(i=0;i<n;i++)
    {
        cin >>ara[i];
    }
    for(i=0;i<t;i++)
    {
        cin >>ara1[i];
    }

    for(i=0;i<m;i++)
    {
        if(ara[k-1]<ara1[i])
        {
            continue;
        }
        else
        {
            printf("NO\n");
            return 0;
        }
    }
     if (i==m)printf("YES\n");

     else cout <<"NO\n";

    return 0;
}


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

int main()
{
    int n,t;

    cin >>n>>t;
    long int ara[n],ara1[t];

    int k,m;

    cin >>k>>m;

    int i=0;
    for(i=0;i<n;i++)
    {
        cin >>ara[i];
    }
    for(i=0;i<t;i++)
    {
        cin >>ara1[i];
    }
    for(i=0;i<m;i++)
    {
        if(ara[k-1]<ara1[--t]) continue;

        else{
            cout <<"NO\n";
            break;
        }
    }
    if(i==m) cout <<"YES\n";

    return 0;
}


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

int main()
{
    int n,t;

    cin >>n>>t;
    long int ara[n],ara1[t];

    int k,m;

    cin >>k>>m;

    int i=0;
    for(i=0;i<n;i++)
    {
        cin >>ara[i];
    }
    for(i=0;i<t;i++)
    {
        cin >>ara1[i];
    }
    if(ara[k-1]<ara1[m-k]) printf("YES\n");

     else cout <<"NO\n";

    return 0;
}


#include <iostream>

using namespace std;

int t[10003];
int s[10003];

int main() {
    int a , b;
    cin>>a>>b;
    long long k , m;
    cin>>k>>m;
    for(int i = 1; i <= a; i++) {
        cin>>t[i];
    }
    for(int i = 1; i <= b; i++) {
        cin>>s[i];
    }
    if(t[a] < s[b - m])
    cout<<"YES";
    else
    cout<<"NO";
    return 0;
}


#include <iostream>

using namespace std;

long long t[10003];
long long s[10003];

int main() {
    int a , b;
    cin>>a>>b;
    int k , m;
    cin>>k>>m;
    for(int i = 1; i <= a; i++) {
        cin>>t[i];
    }
    for(int i = 1; i <= b; i++) {
        cin>>s[i];
    }
    if(t[k] < s[b - m + 1])
    cout<<"YES";
    else
    cout<<"NO";
    return 0;
}


#include <iostream>

using namespace std;

int t[10003];
int s[10003];

int main() {
    int a , b;
    cin>>a>>b;
    int k , m;
    cin>>k>>m;
    for(int i = 1; i <= a; i++) {
        cin>>t[i];
    }
    for(int i = 1; i <= b; i++) {
        cin>>s[i];
    }
    if(t[a] < s[b - m + 1])
    cout<<"YES";
    else
    cout<<"NO";
    return 0;
}


#include <iostream>

using namespace std;

int t[10003];
int s[10003];

int main() {
	int a , b;
	cin>>a>>b;
	int k , m;
	cin>>k>>m;
	for(int i = 1; i <= a; i++) {
		cin>>t[i];
	}
	for(int i = 1; i <= b; i++) {
		cin>>s[i];
	}
	if(t[a] < s[b - m])
	cout<<"YES";
	else
	cout<<"NO";
	return 0;
}


#include <iostream>

using namespace std;

int t[10003];
int s[10003];

int main() {
    int a , b;
    cin>>a>>b;
    int k , m;
    cin>>k>>m;
    for(int i = 1; i <= a; i++) {
        cin>>t[i];
    }
    for(int i = 1; i <= b; i++) {
        cin>>s[i];
    }
    if(t[k] < s[b - m + 1])
    cout<<"YES";
    else
    cout<<"NO";
    return 0;
}


#include <iostream>

using namespace std;

long t[10003];
long s[10003];

int main() {
    int a , b;
    cin>>a>>b;
    int k , m;
    cin>>k>>m;
    for(int i = 1; i <= a; i++) {
        cin>>t[i];
    }
    for(int i = 1; i <= b; i++) {
        cin>>s[i];
    }
    if(t[k] < s[b - m + 1])
    cout<<"YES";
    else
    cout<<"NO";
    return 0;
}


#include <iostream>

using namespace std;

int t[10003];
int s[10003];

int main() {
    int a , b;
    cin>>a>>b;
    int k , m;
    cin>>k>>m;
    for(int i = 1; i <= a; i++) {
        cin>>t[i];
    }
    for(int i = 1; i <= b; i++) {
        cin>>s[i];
    }
    if(t[a] <= s[b - m + 1])
    cout<<"YES";
    else
    cout<<"NO";
    return 0;
}


#include <iostream>

using namespace std;

long long t[10000003];
long long s[10000003];

int main() {
    int a , b;
    cin>>a>>b;
    int k , m;
    cin>>k>>m;
    for(int i = 1; i <= a; i++) {
        cin>>t[i];
    }
    for(int i = 1; i <= b; i++) {
        cin>>s[i];
    }
    if(t[k] < s[b - m + 1])
    cout<<"YES";
    else
    cout<<"NO";
    return 0;
}


#include <iostream>

using namespace std;

int main()
{   int a[30],b[30];
    unsigned  int n1,n2,m,k,i,j;

     cin>>n1>>n2;
     cin>>k>>m;
     for (i=0;i<n1;i++)
     {
         cin>>a[i];
     }
     for(i=0;i<n2;i++)
     {
         cin>>b[i];
     }

       if (b[n2-m]>a[k-1]) cout<<"YES"<<endl;
       else cout<<"NO"<<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{   int a[30],b[30];
    unsigned  int n1,n2,m,k,i,j;

     cin>>n1>>n2;
     cin>>k>>m;
     for (i=0;i<n1;i++)
     {
         cin>>a[i];
     }
     for(i=0;i<n2;i++)
     {
         cin>>b[i];
     }
     if ((n2-m)<0) cout<<"NO"<<endl;
     else{
        j=0;
        while((b[j]<=a[k-1])&&(j<n2))
        {
            j++;
        }
        if (n2-j-1<m)cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
     }

    return 0;
}


#include <iostream>

using namespace std;

int main()
{   int a[30],b[30];
    unsigned  int n1,n2,m,k,i,j;

     cin>>n1>>n2;
     cin>>k>>m;
     for (i=0;i<n1;i++)
     {
         cin>>a[i];
     }
     for(i=0;i<n2;i++)
     {
         cin>>b[i];
     }
     if ((n2-m)<0) cout<<"NO"<<endl;
     else{
        j=0;
        while(((b[j]<a[k-1])||(b[j]==a[k-1]))&&(j<n2))
        {
            j++;
        }
        cout<<j<<endl;
        if (j>n2-m-1)cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
     }

    return 0;
}


#include <iostream>

using namespace std;

int main()
{   long long int a[100000],b[100000];
    long long   int n1,n2,m,k,i,j;

     cin>>n1>>n2;
     cin>>k>>m;
     for (i=0;i<n1;i++)
     {
         cin>>a[i];
     }
     for(i=0;i<n2;i++)
     {
         cin>>b[i];
     }
        if (b[n2-m]>a[k-1]) cout<<"YES"<<endl;
       else cout<<"NO"<<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{   unsigned int a[100000],b[100000];
    unsigned  int n1,n2,m,k,i,j;

     cin>>n1>>n2;
     cin>>k>>m;
     for (i=0;i<n1;i++)
     {
         cin>>a[i];
     }
     for(i=0;i<n2;i++)
     {
         cin>>b[i];
     }

       if (b[n2-m]>a[k-1]) cout<<"YES"<<endl;
       else cout<<"NO"<<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{   unsigned int a[100000],b[100000];
    unsigned  int n1,n2,m,k,i,j;

     cin>>n1>>n2;
     cin>>k>>m;
     for (i=0;i<n1;i++)
     {
         cin>>a[i];
     }
     for(i=0;i<n2;i++)
     {
         cin>>b[i];
     }
        if ((k==m==1)&&(b[0]>a[0])) cout<<"YES"<<endl;
       else if (b[n2-m]>a[k-1]) cout<<"YES"<<endl;
       else cout<<"NO"<<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{   int a[30],b[30];
    unsigned  int n1,n2,m,k,i,j;

     cin>>n1>>n2;
     cin>>k>>m;
     for (i=0;i<n1;i++)
     {
         cin>>a[i];
     }
     for(i=0;i<n2;i++)
     {
         cin>>b[i];
     }
     cout<<b[n2-m]<<endl;
     cout<<a[k-1]<<endl;
       if (b[n2-m]>a[k-1]) cout<<"YES"<<endl;
       else cout<<"NO"<<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{   int a[30],b[30];
    unsigned  int n1,n2,m,k,i,j;

     cin>>n1>>n2;
     cin>>k>>m;
     for (i=0;i<n1;i++)
     {
         cin>>a[i];
     }
     for(i=0;i<n2;i++)
     {
         cin>>b[i];
     }
     if ((n2-m)<0) cout<<"NO"<<endl;
     else{
        j=0;
        while(((b[j]<a[k-1])||(b[j]==a[k-1]))&&(j<n2))
        {
            j++;
        }

        if (j>n2-m-1)cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
     }

    return 0;
}


#include <iostream>

using namespace std;

int main()
{   int a[30],b[30];
    unsigned  int n1,n2,m,k,i,j;

     cin>>n1>>n2;
     cin>>k>>m;
     for (i=0;i<n1;i++)
     {
         cin>>a[i];
     }
     for(i=0;i<n2;i++)
     {
         cin>>b[i];
     }
     if ((n2-m)<0) cout<<"NO"<<endl;
     else{
        j=0;
        while(((b[j]<a[k-1])||(b[j]==a[k-1]))&&(j<n2))
        {
            j++;
        }

        if (j>n2-m)cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
     }

    return 0;
}


#include <stdio.h>
using namespace std ;
void quick_sort(int data[], int low, int high)
{
  int a; //deklarasikan a sebagai poros
   int up,down;
   int temp;

   if (low>=high)
    return;
   a=data[low];
   up=high;
   down=low;

   while (down < up)
   {
     while (data[down] <= a)
       down++;
      while (data[up]>a)
       up--;
      if(down<up)
      {
        temp=data[down];
         data[down]=data[up];
         data[up]=temp;
      }
   }
   data[low]=data[up];
   data[up]=a;

   quick_sort(data,low,up-1); //lakukan quick sort pada sub array <= poros
   quick_sort(data,up+1,high); //lakukan quick soort pada sub array > poros
}

int main(){
    int x, y, k, m;
    scanf("%d %d", &x, &y);
    scanf("%d %d", &k, &m);

    int A[x], B[y];
    for(int i = 0; i < x; i++){
        scanf("%d", &A[i]);
    }
    for(int i = 0; i < y; i++){
        scanf("%d", &B[i]);
    }
    quick_sort(A, 0, x-1);
    quick_sort(B, 0, y-1);
    if(A[k-1]<B[y-m])
        printf("YES\n");
    else
        printf("NO\n");
}


#include <stdio.h>
using namespace std ;
void quick_sort(int data[], int low, int high)
{
  int a;
   int up,down;
   int temp;

   if (low>=high)
    return;
   a=data[low];
   up=high;
   down=low;

   while (down < up)
   {
     while (data[down] <= a)
       down++;
      while (data[up]>a)
       up--;
      if(down<up)
      {
        temp=data[down];
         data[down]=data[up];
         data[up]=temp;
      }
   }
   data[low]=data[up];
   data[up]=a;

   quick_sort(data,low,up-1); //lakukan quick sort pada sub array <= poros
   quick_sort(data,up+1,high); //lakukan quick soort pada sub array > poros
}

int main(){
    int x, y, k, m;
    scanf("%d %d", &x, &y);
    scanf("%d %d", &k, &m);

    int A[x], B[y];
    for(int i = 0; i < x; i++){
        scanf("%d", &A[i]);
    }
    for(i = 0; i < y; i++){
        scanf("%d", &B[i]);
    }
    quick_sort(A, 0, x-1);
    quick_sort(B, 0, y-1);
    if(A[k-1]<B[y-m])
        printf("YES\n");
    else
        printf("NO\n");
}


#include <stdio.h>
using namespace std ;
void quick_sort(int data[], int low, int high)
{
  int a;
   int up,down;
   int temp;

   if (low>=high)
    return;
   a=data[low];
   up=high;
   down=low;

   while (down < up)
   {
     while (data[down] <= a)
       down++;
      while (data[up]>a)
       up--;
      if(down<up)
      {
        temp=data[down];
         data[down]=data[up];
         data[up]=temp;
      }
   }
   data[low]=data[up];
   data[up]=a;

   quick_sort(data,low,up-1); //lakukan quick sort pada sub array <= poros
   quick_sort(data,up+1,high); //lakukan quick soort pada sub array > poros
}

int main(){
	int x, y, k, m, i;
	scanf("%d %d", &x, &y);
	scanf("%d %d", &k, &m);

	int A[x], B[y];
	for(i = 0; i < x; i++){
		scanf("%d", &A[i]);
	}
	for(i = 0; i < y; i++){
		scanf("%d", &B[i]);
	}
	quick_sort(A, 0, x-1);
	quick_sort(B, 0, y-1);
	if(A[k-1]<B[y-m])
		printf("YES\n");
	else
		printf("NO\n");
}


#include <stdio.h>
using namespace std ;
void quick_sort (int *a, int n) {
    int i, j, pivot, t;
    if (n < 2)
        return;
	pivot = a[n / 2];
    for (i = 0, j = n - 1;; i++, j--) {
        while (a[i] < pivot)
            i++;
        while (pivot < a[j])
            j--;
        if (i >= j)
            break;
        t = a[i];
        a[i] = a[j];
        a[j] = t;
    }
	quick_sort(a, i);
    quick_sort(a + i, n - i);
}

int main(){
	int x, y, k, m, i;
	scanf("%d %d", &x, &y);
	scanf("%d %d", &k, &m);

	int A[x], B[y];
	for(i = 0; i < x; i++){
		scanf("%d", &A[i]);
	}
	for(i = 0; i < y; i++){
		scanf("%d", &B[i]);
	}
	quick_sort(A, x);
	quick_sort(B, y);
	if(A[k-1]<B[y-m])
		printf("YES\n");
	else
		printf("NO\n");
}


#include <iostream>
#define max 1000
using namespace std ;
void quick_sort(int data[], int low, int high)
{
  int a; //deklarasikan a sebagai poros
   int up,down;
   int temp;

   if (low>=high)
    return;
   a=data[low];
   up=high;
   down=low;

   while (down < up)
   {
     while (data[down] <= a)
       down++;
      while (data[up]>a)
       up--;
      if(down<up)
      {
        temp=data[down];
         data[down]=data[up];
         data[up]=temp;
      }
   }
   data[low]=data[up];
   data[up]=a;

   quick_sort(data,low,up-1); //lakukan quick sort pada sub array <= poros
   quick_sort(data,up+1,high); //lakukan quick soort pada sub array > poros
}

int main(){
	int x, y, k, m;
	cin>>x>>y;
	cin>>k>>m;
	int A[x], B[y];
	for(int i = 0; i < x; i++){
		cin>>A[i];
	}
	for(int i = 0; i < y; i++){
		cin>>B[i];
	}
	quick_sort(A, 0, x-1);
	quick_sort(B, 0, y-1);
	if(A[k-1]<B[y-m])
		cout<<"YES\n";
	else
		cout<<"NO\n";
}


#include <stdio.h>
using namespace std ;
void quick_sort(int data[], int low, int high)
{
  int a; //deklarasikan a sebagai poros
   int up,down;
   int temp;

   if (low>=high)
    return;
   a=data[low];
   up=high;
   down=low;

   while (down < up)
   {
     while (data[down] <= a)
       down++;
      while (data[up]>a)
       up--;
      if(down<up)
      {
        temp=data[down];
         data[down]=data[up];
         data[up]=temp;
      }
   }
   data[low]=data[up];
   data[up]=a;

   quick_sort(data,low,up-1); //lakukan quick sort pada sub array <= poros
   quick_sort(data,up+1,high); //lakukan quick soort pada sub array > poros
}

int main(){
    int x, y, k, m;
    scanf("%d %d", &x, &y);
    scanf("%d %d", &k, &m);

    int A[x], B[y];
    for(int i = 0; i < x; i++){
        scanf("%d", &A[i]);
    }
    for(int i = 0; i < y; i++){
        scanf("%d", &B[i]);
    }
    quick_sort(A, 0, x-1);
    quick_sort(B, 0, y-1);
    if(A[k-1]<B[y-m])
        printf("YES\n");
    else
        printf("NO\n")
}


#include <iostream>
#define max 1000
using namespace std ;
void quick_sort(int data[], int low, int high)
{
  int a; //deklarasikan a sebagai poros
   int up,down;
   int temp;

   if (low>=high)
    return;
   a=data[low];
   up=high;
   down=low;

   while (down < up)
   {
     while (data[down] <= a)
       down++;
      while (data[up]>a)
       up--;
      if(down<up)
      {
        temp=data[down];
         data[down]=data[up];
         data[up]=temp;
      }
   }
   data[low]=data[up];
   data[up]=a;

   quick_sort(data,low,up-1); //lakukan quick sort pada sub array <= poros
   quick_sort(data,up+1,high); //lakukan quick soort pada sub array > poros
}

int main(){
	int x, y, k, m;
	cin>>x>>y;
	cin>>k>>m;
	int A[x], B[y];
	for(int i = 0; i < x; i++){
		cin>>A[i];
	}
	for(int i = 0; i < y; i++){
		cin>>B[i];
	}
	quick_sort(A, 0, x-1);
	quick_sort(B, 0, y-1);
	if(A[k-1]<B[0])
		cout<<"YES\n";
	else
		cout<<"NO\n";
}


#include<bits/stdc++.h>
using namespace std;
int i,n,a[1000001],b[1000001],k,m,l;
int t;
int main()
{
scanf("%d%d",&n,&m);

scanf("%d%d",&k,&l);

for(i=0;i<n;i++)
    cin>>a[i];
for(i=0;i<m;i++)
    cin>>b[i];

if(a[k-1]<b[m-l])
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int i,n,j,a[1000001],b[1000001],k,m,l;
int t;
int main()
{
scanf("%d%d",&n,&m);

scanf("%d%d",&k,&l);

for(i=0;i<n;i++)
    cin>>a[i];
for(i=0;i<m;i++)
    cin>>b[i];
i=n-1,j=0;
int flag=0;
while(i>=0 && j<m)
{
    if(a[i]==b[j])
    i--;
   else if(a[i]>b[j])
        j++;
    else if(a[i]<b[j])
        break;

}
if(n==1)
{
    if(a[0]<b[0])
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
}
else if(i+1>=k && m-j+1>=l)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}
/*
4 4
3 2
1 3 4 6
3 4 6 7
*/


#include<bits/stdc++.h>
using namespace std;
int i,n,a[100001],b[1000001],k,m,l;
int t;
int main()
{
scanf("%d%d",&n,&m);

scanf("%d%d",&k,&l);

for(i=0;i<n;i++)
    cin>>a[i];
for(i=0;i<m;i++)
    cin>>b[i];

if(a[k-1]<b[m-l-1])
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int i,n,j,a[1000001],b[1000001],k,m,l;
int t;
int main()
{
scanf("%d%d",&n,&m);

scanf("%d%d",&k,&l);

for(i=0;i<n;i++)
    cin>>a[i];
for(i=0;i<m;i++)
    cin>>b[i];
i=n-1,j=0;
int flag=0;
while(i>=0 && j<m)
{
    if(a[i]==b[j])
    i--;
   else if(a[i]>b[j])
        j++;
    else if(a[i]<b[j])
        break;

}
if(i+1>=k && m-j+1>=l)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}
/*
4 4
3 2
1 3 4 6
3 4 6 7
*/


#include<bits/stdc++.h>
using namespace std;
int i,n,j,a[1000001],b[1000001],k,m,l;
int t;
int main()
{
scanf("%d%d",&n,&m);

scanf("%d%d",&k,&l);

for(i=0;i<n;i++)
    cin>>a[i];
for(i=0;i<m;i++)
    cin>>b[i];
i=n-1,j=0;
int flag=0;
sort(a,a+n);
sort(b,b+m);
while(i>=0 && j<m)
{
    if(a[i]==b[j])
    i--;
   else if(a[i]>b[j])
        j++;
    else if(a[i]<b[j])
        break;

}
if(n==1)
{
    if(a[0]<b[0])
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
}
else if(i+1>=k && m-j+1>=l)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}
/*
4 4
3 2
1 3 4 6
3 4 6 7
*/


#include<bits/stdc++.h>
using namespace std;
int i,n,j,a[100001],b[1000001],k,m,l;
int t;
int main()
{
scanf("%d%d",&n,&m);

scanf("%d%d",&k,&l);

for(i=0;i<n;i++)
    cin>>a[i];
for(i=0;i<m;i++)
    cin>>b[i];
i=0,j=0;
while(i<n && j<m)
{
    if(a[i]<b[j])
        i++;
    else
        j++;
}

if(i+1>=k && j+1>=l)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int i,n,j,a[100001],b[1000001],k,m,l;
int t;
int main()
{
scanf("%d%d",&n,&m);

scanf("%d%d",&k,&l);

for(i=0;i<n;i++)
    cin>>a[i];
for(i=0;i<m;i++)
    cin>>b[i];
i=n-1,j=0;
int flag=0;
while(i>=0 || j<m)
{
    if(a[i]==b[j])
    i--;
   else if(a[i]>b[j])
        j++;
    else if(a[i]<b[j])
        break;

}
if(i+1>=k && m-j+1>=l)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}
/*
4 4
3 2
1 3 4 6
3 4 6 7
*/


#include<bits/stdc++.h>
using namespace std;
int a[1000001],m,n,i,j,mi,b[1000001],k,v,n2,n1;
int main(){

cin>>n1>>n2;
cin>>k>>m;
for(i=0;i<n1;i++)
{
    scanf("%d",&a[i]);
}

for(i=0;i<n2;i++)
{
    scanf("%d",&b[i]);
}
    sort(a,a+n1);
    sort(b,b+n2);
    v=a[k-1];
    for(i=0;i<n2;i++)
    {
        if(v<b[i])
            {
            j=n2-i;
            break;
            }

    }
       if(j>=m)
       cout<<"YES"<<endl;
       else
       cout<<"NO"<<endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long a1[1000000],a2[1000000];
int main()
{
    int n1,n2,k,m,i,j,l,p;
    while(scanf("%d %d %d %d",&n1,&n2,&k,&m)==4)
    {
        for(i=0;i<n1;i++)
        {
            scanf("%lld",&a1[i]);
        }
        for(i=0;i<n2;i++)
        {
            scanf("%lld",&a2[i]);
        }
        sort(a1,a1+n1);
        sort(a2,a2+n2);
        l=0;
        for(i=0;i<k;i++)
        {

            for(j=m;j>0;j++)
            {
                if(a1[i]<a2[j])
                    p=1;
                    else
                        p=0;
                        break;
            }

        }
        if(p==1)
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long int a1[1000000],a2[1000000];
int main()
{
    long long  n1,n2,k,m,i,j,l,p;
    while(scanf("%lld %lld %lld %lld",&n1,&n2,&k,&m)==4)
    {
        for(i=0;i<n1;i++)
        {
            scanf("%lld",&a1[i]);
        }
        for(i=0;i<n2;i++)
        {
            scanf("%lld",&a2[i]);
        }
        sort(a1,a1+n1);
        sort(a2,a2+n2);
        l=0;
        for(i=0;i<k;i++)
        {
            p=0;
            for(j=(n2-1);j>=(n2-m);j--)
            {
                if(a1[i]<a2[j])
                    {
                        p=1;
                    }
                    else
                       {
                            p=0;
                        break;
                       }
            }
            if(p==0)
                break;
            else
                l++;

        }
        if(l==k)
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long a1[1000000],a2[1000000];
int main()
{
    int n1,n2,k,m,i,j,l,p;
    while(scanf("%d %d %d %d",&n1,&n2,&k,&m)==4)
    {
        for(i=0;i<n1;i++)
        {
            scanf("%lld",&a1[i]);
        }
        for(i=0;i<n2;i++)
        {
            scanf("%lld",&a2[i]);
        }
        sort(a1,a1+n1);
        sort(a2,a2+n2);
        p=0;
        for(i=0;i<k;i++)
        {

            for(j=m;j>0;j++)
            {
                if(a1[i]<a2[j])
                    p=1;
                    else
                        p=0;
                        break;
            }

        }
        if(p==1)
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long int a1[1000000],a2[1000000];
int main()
{
    long long  n1,n2,k,m,i,j,l,p;
    while(scanf("%lld %lld %lld %lld",&n1,&n2,&k,&m)==4)
    {
        for(i=0;i<n1;i++)
        {
            scanf("%lld",&a1[i]);
        }
        for(i=0;i<n2;i++)
        {
            scanf("%lld",&a2[i]);
        }
        sort(a1,a1+n1);
        sort(a2,a2+n2);
        l=0;
        for(i=0;i<k;i++)
        {
            p=0;
            for(j=(n2-1);j>=(n2-m);j--)
            {
                if(a1[i]<a2[j])
                    {
                        p=1;
                    }
                    else
                       {
                            p=0;
                        break;
                       }
            }
            if(p==0)
                break;
                elsea
                    l++;

        }
        if(l==k)
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}


#include <iostream>

using namespace std;

int main(){
int ab,bb;
cin>>ab;
cin>>bb;
int a[ab];
int b[ab];
int k,m,w,v,r;
cin>>k;
cin>>m;
for(int i =0;i<ab;i++){
    cin >>a[i];

for(int j=0;j<bb;j++){

    cin>>b[j];

}

if(a[k-1]<b[m-1])
cout<<"YES";
else
cout<<"NO";

}


#include <iostream>

using namespace std;

int main(){
int ab,bb;
cin>>ab;
cin>>bb;
int a[ab];
int b[ab];
int k,m;
cin>>k;
cin>>m;
for(int i =0;i<ab;i++){
    cin >>a[i];

}
for(int j=0;j<bb;j++){

    cin>>b[j];

}
if(b[k]>a[m])
cout<<"YES";
else
cout<<"NO";

}


#include <iostream>

using namespace std;

int main(){
int ab,bb;
cin>>ab;
cin>>bb;
int a[10000];
int b[10000];
int k,m;
cin>>k;
cin>>m;
for(int i =0;i<ab;i++){
    cin >>a[i];

for(int j=0;j<bb;j++){

    cin>>b[j];

}
}
if(a[k-1]<b[m-1])
cout<<"YES";
else
cout<<"NO";

}


#include <iostream>

using namespace std;

int main(){
int ab,bb;
cin>>ab;
cin>>bb;
int a[ab];
int b[ab];
int k,m,w,v,r;
cin>>k;
cin>>m;
for(int i =0;i<ab;i++){
    cin >>a[i];
}
for(w=0;w<ab;w++){
    for(v=0;v<ab;v++){
        if(a[w]>a[v]){
            r=a[w];
            a[w]=a[v];
            a[v]=r;

        }

    }

}
for(int j=0;j<bb;j++){

    cin>>b[j];

}
for(w=0;w<ab;w++){
    for(v=0;v<ab;v++){
        if(a[w]>a[v]){
            r=a[w];
            a[w]=a[v];
            a[v]=r;

        }

    }
}
if(b[k]>a[m])
cout<<"YES";
else
cout<<"NO";

}


#include <iostream>

using namespace std;

int main(){
int ab,bb;
cin>>ab;
cin>>bb;
int a[ab];
int b[ab];
int k,m,w,v,r;
cin>>k;
cin>>m;
for(int i =0;i<ab;i++){
    cin >>a[i];
}
for(w=0;w<ab;w++){
    for(v=0;v<ab;v++){
        if(a[w]>a[v]){
            r=a[w];
            a[w]=a[v];
            a[v]=r;

        }

    }

}
for(int j=0;j<bb;j++){

    cin>>b[j];

}
for(w=0;w<ab;w++){
    for(v=0;v<ab;v++){
        if(a[w]>a[v]){
            r=a[w];
            a[w]=a[v];
            a[v]=r;

        }

    }
}
if(b[k-1]>a[m-1])
cout<<"YES";
else
cout<<"NO";

}


#include <iostream>

using namespace std;

int main(){
int ab,bb;
cin>>ab;
cin>>bb;
int a[ab];
int b[bb];
int k,m,w,v,r;
cin>>k;
cin>>m;
for(int i =0;i<ab;i++){
    cin >>a[i];

for(int j=0;j<bb;j++){

    cin>>b[j];

}

if(a[k-1]<b[m-1])
cout<<"YES";
else
cout<<"NO";

}


#include <iostream>

using namespace std;

int main(){
int ab,bb;
cin>>ab;
cin>>bb;
int a[ab];
int b[ab];
for(int i =0;i<ab;i++){
    cin >>a[i];

}
for(int j=0;j<bb;j++){

    cin>>b[j];

}
if(b>a)
cout<<"YES";
else
cout<<"NO";

}


#include <iostream>

using namespace std;

int main(){
int ab,bb;
cin>>ab;
cin>>bb;
int a[ab];
int b[bb];
int k,m;
cin>>k;
cin>>m;
for(int i =0;i<ab;i++){
    cin >>a[i];

for(int j=0;j<bb;j++){

    cin>>b[j];

}
}
if(a[k-1]<b[m-1])
cout<<"YES";
else
cout<<"NO";

}


#include <iostream>

using namespace std;

int main(){
int ab,bb;
cin>>ab;
cin>>bb;
int a[10000];
int b[10000];
int k,m;
cin>>k;
cin>>m;
for(int i =0;i<ab;i++){
    cin >>a[i];

for(int j=0;j<bb;j++){

    cin>>b[j];

}

if(a[k-1]<b[m-1])
cout<<"YES";
else
cout<<"NO";

}
}


#include<bits/stdc++.h>
using namespace std;
int b[10001];
int main(){
    int n1,n2,a,i,k,l;
    int tmp=0,tmp2=0;
    cin >> n1>>n2;
    cin >> k >> l;
    for(i=0;i<n1;i++){
        cin >> a;
        if(i==k-1){
            tmp=a;
        }
    }
    for(i=0;i<n2;i++){
        cin >> a;
        if(a>tmp)
            tmp2++;
    }
    if(tmp2 >= l)
        cout << "YES";
    else
        cout <<"NO";

}


#include <iostream>

using namespace std;

int main(){
int ab=0;
int bb=0;
cin>>ab;
cin>>bb;
int a[ab];
int b[bb];
int k=0;
int m=0;
cin>>k;
cin>>m;
for(int i =0;i<ab;i++){
    cin >>a[i];
}
for(int j=0;j<bb;j++){

    cin>>b[j];

}

if(a[k-1]<b[m-1])
cout<<"YES";
else
cout<<"NO";

}


#include <iostream>

using namespace std;

int main(){
int ab,bb;
cin>>ab;
cin>>bb;
int a[ab];
int b[ab];
int k,m,w,v,r;
cin>>k;
cin>>m;
for(int i =0;i<ab;i++){
    cin >>a[i];
}
for(w=0;w<ab;w++){
    for(v=0;v<ab;v++){
        if(a[w]>a[v]){
            r=a[w];
            a[w]=a[v];
            a[v]=r;

        }

    }

}
for(int j=0;j<bb;j++){

    cin>>b[j];

}
for(w=0;w<ab;w++){
    for(v=0;v<ab;v++){
        if(a[w]>a[v]){
            r=a[w];
            a[w]=a[v];
            a[v]=r;

        }

    }
}
if(b[k-1]>=a[m-1])
cout<<"YES";
else
cout<<"NO";

}


#include <iostream>

using namespace std;

int main(){
int ab,bb;
cin>>ab;
cin>>bb;
int a[ab];
int b[bb];
int k,m;
cin>>k;
cin>>m;
for(int i =0;i<ab;i++){
    cin >>a[i];
}
for(int j=0;j<bb;j++){

    cin>>b[j];

}

if(a[k-1]<b[m-1])
cout<<"YES";
else
cout<<"NO";

}


#include <iostream>

using namespace std;

int main(){
int ab,bb;
cin>>ab;
cin>>bb;
int a[ab];
int b[bb];
int k,m;
cin>>k;
cin>>m;
for(int i =0;i<ab;i++){
    cin >>a[i];

for(int j=0;j<bb;j++){

    cin>>b[j];

}

if(a[k-1]<b[m-1])
cout<<"YES";
else
cout<<"NO";

}
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define sz 100010

int main()
{

    long long int i, j, k, n, m, t, p, arr[sz], arr1[sz], v, c, min1, max1;

    while(scanf("%I64d %I64d", &n, &m)==2)
    {
        scanf("%I64d %I64d", &t, &p);
        for( i=0; i<n; i++)
        {
            scanf("%I64d", &arr[i]);
        }
        v=arr[t-1];
        for( j=0; j<m; j++)
        {
            scanf("%I64d", &arr1[j]);
        }
        c=arr1[0];
        if(v<c) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define sz 100010

int main()
{

    long long int i, j, k, n, m, t, p, arr[sz], arr1[sz], v, c, min1, max1;

    while(scanf("%I64d %I64d", &n, &m)==2)
    {
        scanf("%I64d %I64d", &t, &p);
        for( i=0; i<n; i++)
        {
            scanf("%I64d", &arr[i]);
        }
        v=arr[t-1];
        for( j=0; j<m; j++)
        {
            scanf("%I64d", &arr1[j]);
        }

        if(v<c) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define sz 100010

int main()
{

    long long int i, j, k, n, m, t, p, arr[sz], arr1[sz], v, c, min1, max1;

    while(scanf("%I64d %I64d", &n, &m)==2)
    {
        scanf("%I64d %I64d", &t, &p);
        for( i=0; i<n; i++)
        {
            scanf("%I64d", &arr[i]);
        }
        v=arr[t-1];
        for( j=0; j<m; j++)
        {
            scanf("%I64d", &arr1[j]);
        }

        if(v<c) printf("Yes\n");
        else printf("No\n");
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define sz 100010
int flag[sz], tag[sz];
int main()
{

    int i, j, k, n, m, t, p, arr[sz], arr1[sz];

    while(scanf("%d %d", &n, &m)==2)
    {int v=0, c=0;
        memset(flag, 0, sizeof flag);
        memset(tag, 0, sizeof tag);
        scanf("%d %d", &t, &p);
        for( i=0; i<n; i++)
        {
            scanf("%d", &arr[i]);
            //flag[arr[i]]++;
        }
        for( j=0; j<m; j++)
        {
            scanf("%d", &arr1[j]);
            //tag[arr1[j]]++;
        }

        for( i=0; i<n; i++)
        {
            for( j=0; j<m; j++)
            {
                if(arr[i]<arr1[j]) flag[i]++;
            }
            if(flag[i]>=p) v++;
        }
        if(v<t) printf("No\n");
        else printf("Yes\n");
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define sz 100010

int main()
{

    long long int i, j, k, n, m, t, p, arr[sz], arr1[sz], v, c, min1, max1;

    while(scanf("%I64d %I64d", &n, &m)==2)
    {
        scanf("%I64d %I64d", &t, &p);
        for( i=0; i<n; i++)
        {
            scanf("%I64d", &arr[i]);
        }
        for( j=0; j<m; j++)
        {
            scanf("%I64d", &arr1[j]);
        }
        v=arr[t-1];
        c=arr1[p-1];
        if(v>=c) printf("No\n");
        else if(v<c) printf("Yes\n");
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define sz 100010

int main()
{

    long long int i, j, k, n, m, t, p, arr[sz], arr1[sz], v, c, min1, max1;

    while(scanf("%I64d %I64d", &n, &m)==2)
    {
        scanf("%I64d %I64d", &t, &p);
        for( i=0; i<n; i++)
        {
            scanf("%I64d", &arr[i]);
        }
        v=arr[t-1];
        for( j=0; j<m; j++)
        {
            scanf("%I64d", &arr1[j]);
        }
        c=arr1[0];
        if(v<c || ((v==c)&& c==1 && m>1)) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define sz 100010

int main()
{

    long long int i, j, k, n, m, t, p, arr[sz], arr1[sz], v, c, min1, max1;

    while(scanf("%I64d %I64d", &n, &m)==2)
    {
        scanf("%I64d %I64d", &t, &p);
        for( i=0; i<n; i++)
        {
            scanf("%I64d", &arr[i]);
        }
        v=arr[t-1];
        for( j=0; j<m; j++)
        {
            scanf("%I64d", &arr1[j]);
        }
        c=arr1[m-p];//printf("%I64d %I64d\n", v, c);
        if(v<c) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define sz 100010

int main()
{

    long long int i, j, k, n, m, t, p, arr[sz], arr1[sz], v, c, min1, max1;

    while(scanf("%I64d %I64d", &n, &m)==2)
    {
        scanf("%I64d %I64d", &t, &p);
        for( i=0; i<n; i++)
        {
            scanf("%I64d", &arr[i]);
        }
        v=arr[t-1];
        for( j=0; j<m; j++)
        {
            scanf("%I64d", &arr1[j]);
        }
        c=arr1[m-t];//printf("%I64d %I64d\n", v, c);
        if(v<c) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define sz 100010

int main()
{

    long long int i, j, k, n, m, t, p, arr[sz], arr1[sz], v, c, min1, max1;

    while(scanf("%I64d %I64d", &n, &m)==2)
    {
        scanf("%I64d %I64d", &t, &p);
        for( i=0; i<n; i++)
        {
            scanf("%I64d", &arr[i]);
        }
        v=arr[t-1];
        for( j=0; j<m; j++)
        {
            scanf("%I64d", &arr1[j]);
        }
        c=arr1[0];
        if(v<c || ((v==c)&& t==1 && m>1 && arr1[1]>c)) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define sz 100010

int main()
{

    long long int i, j, k, n, m, t, p, arr[sz], arr1[sz], v, c, min1, max1;

    while(scanf("%I64d %I64d", &n, &m)==2)
    {
        scanf("%I64d %I64d", &t, &p);
        for( i=0; i<n; i++)
        {
            scanf("%I64d", &arr[i]);
        }
        v=arr[t-1];
        for( j=0; j<m; j++)
        {
            scanf("%I64d", &arr1[j]);
        }
        c=arr1[0];
        if(v<c || ((v==c)&& m>1 && arr1[1]>c)) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}


#include "stdio.h"
#include "algorithm"
using namespace std;

#define MAX 100000

int main()
{
	long na, nb;
	long k, m;
	long A[MAX], B[MAX];
	bool result = false;
	bool breaker = false;
	int countk = 0;
	int countm = 0;
	freopen("Input.txt", "rt", stdin);
	scanf("%ld%ld", &na, &nb);
	scanf("%ld%ld", &k, &m);
	for (int i = 0; i < na; i++)
		scanf("%ld", &A[i]);
	for (int i = 0; i < nb; i++)
		scanf("%ld", &B[i]);
	for (int i = 0; i < na; i++)
	{
		for (int j = nb - 1; j >= 0; j--)
		{
			if (B[j]>A[i])
				countm++;
			else
			{
				breaker = true;
				break;
			}
			if (countm == m)
			{
				countm = 0;
				countk++;
				break;
			}
		}
		if (breaker)
			break;
		if (countk == k)
		{
			result = true;
			break;
		}
	}
	if (result)
		printf("YES");
	else
		printf("NO");
	return 0;
}


#include "stdio.h"
#include "algorithm"
using namespace std;

#define MAX 100000

bool myfunction(long x, long B[], long nb,long m)
{
	for (int i = 0; i <= nb - m; i++)
	{
		if (x < B[i])
		{
				return true;
		}
	}
	return false;
}
int main()
{
	long na, nb;
	long k, m;
	long A[MAX], B[MAX];
	bool result = false;
	bool breaker = false;

	//freopen("Input.txt", "rt", stdin);
	scanf("%ld%ld", &na, &nb);
	scanf("%ld%ld", &k, &m);
	for (int i = 0; i < na; i++)
		scanf("%ld", &A[i]);
	for (int i = 0; i < nb; i++)
		scanf("%ld", &B[i]);

	if (A[k - 1] < B[nb - m])
		printf("YES");
	else
		printf("NO");
	return 0;
}


#include "stdio.h"
#include "algorithm"
using namespace std;

#define MAX 100000

bool myfunction(long x, long B[], long nb,long m)
{
	for (int i = 0; i <= nb - m; i++)
	{
		if (x < B[i])
		{
				return true;
		}
	}
	return false;
}
int main()
{
	long na, nb;
	long k, m;
	long A[MAX], B[MAX];
	bool result = false;
	bool breaker = false;
	int countk = 0;
	int countm = 0;
	//freopen("Input.txt", "rt", stdin);
	scanf("%ld%ld", &na, &nb);
	scanf("%ld%ld", &k, &m);
	for (int i = 0; i < na; i++)
		scanf("%ld", &A[i]);
	for (int i = 0; i < nb; i++)
		scanf("%ld", &B[i]);

	int temp = -1;
	for (int i = na-1; i >= k-1; i--)
	{
		if (temp != A[i])
		{
			temp = A[i];
			if (myfunction(A[i], B, nb, m))
			{
				result = true;
				break;
			}
		}
	}
	if (result)
		printf("YES");
	else
		printf("NO");
	return 0;
}


#include "stdio.h"
#include "algorithm"
using namespace std;

#define MAX 100000

bool myfunction(long x, long B[], long nb,long m)
{
	for (int i = 0; i <= nb - m; i++)
	{
		if (x < B[i])
		{
				return true;
		}
	}
	return false;
}
int main()
{
	long na, nb;
	long k, m;
	long A[MAX], B[MAX];
	bool result = false;
	bool breaker = false;
	int countk = 0;
	int countm = 0;
	//freopen("Input.txt", "rt", stdin);
	scanf("%ld%ld", &na, &nb);
	scanf("%ld%ld", &k, &m);
	for (int i = 0; i < na; i++)
		scanf("%ld", &A[i]);
	for (int i = 0; i < nb; i++)
		scanf("%ld", &B[i]);

	int temp = -1;
	for (int i = na-1; i >= k; i--)
	{
		if (temp != A[i])
		{
			temp = A[i];
			if (myfunction(A[i], B, nb, m))
			{
				result = true;
				break;
			}
		}
	}
	if (result)
		printf("YES");
	else
		printf("NO");
	return 0;
}


#include "stdio.h"
#include "algorithm"
using namespace std;

#define MAX 100000

bool myfunction(long x, long B[], long nb,long m)
{
	for (int i = 0; i < nb; i++)
	{
		if (x < B[i])
		{
			if (nb - i >= m)
				return true;
		}
	}
	return false;
}
int main()
{
	long na, nb;
	long k, m;
	long A[MAX], B[MAX];
	bool result = false;
	bool breaker = false;
	int countk = 0;
	int countm = 0;

	scanf("%ld%ld", &na, &nb);
	scanf("%ld%ld", &k, &m);
	for (int i = 0; i < na; i++)
		scanf("%ld", &A[i]);
	for (int i = 0; i < nb; i++)
		scanf("%ld", &B[i]);

	int temp = -1;
	for (int i = na-1; i >= 0; i--)
	{
	    if(temp != A[i])
	    {
		    temp = A[i];
    		if (myfunction(A[i], B, nb, m))
    		{
    			result = true;
    			break;
    		}
    		if (na - i < k)
    			break;
	    }
	}
	if (result)
		printf("YES");
	else
		printf("NO");
	return 0;
}


#include "stdio.h"
#include "algorithm"
using namespace std;

#define MAX 100000

int main()
{
	long na, nb;
	long k, m;
	long A[MAX], B[MAX];
	bool result = false;
	bool breaker = false;

	freopen("Input.txt", "rt", stdin);
	scanf("%ld%ld", &na, &nb);
	scanf("%ld%ld", &k, &m);
	for (int i = 0; i < na; i++)
		scanf("%ld", &A[i]);
	for (int i = 0; i < nb; i++)
		scanf("%ld", &B[i]);

	if (A[k - 1] < B[nb - m])
		printf("YES");
	else
		printf("NO");
	return 0;
}


#include "stdio.h"
#include "algorithm"
using namespace std;

#define MAX 100000

bool myfunction(long x, long B[], long nb,long m)
{
	for (int i = 0; i < nb; i++)
	{
		if (x < B[i])
		{
			if (nb - i >= m)
				return true;
		}
	}
	return false;
}
int main()
{
	long na, nb;
	long k, m;
	long A[MAX], B[MAX];
	bool result = false;
	bool breaker = false;
	int countk = 0;
	int countm = 0;

	scanf("%ld%ld", &na, &nb);
	scanf("%ld%ld", &k, &m);
	for (int i = 0; i < na; i++)
		scanf("%ld", &A[i]);
	for (int i = 0; i < nb; i++)
		scanf("%ld", &B[i]);

	int temp = -1;
	for (int i = na-1; i >= 0; i--)
	{
	    if(temp!=A[i])
	    {
    		temp = A[i];
    		if (myfunction(A[i], B, nb, m))
    		{
    			result = true;
    			break;
    		}
	    }
	    if (i < k)
    		break;
	}
	if (result)
		printf("YES");
	else
		printf("NO");
	return 0;
}


#include "stdio.h"
#include "algorithm"
using namespace std;

#define MAX 100000

int main()
{
	long na, nb;
	long k, m;
	long A[MAX], B[MAX];
	bool result = false;
	bool breaker = false;
	int countk = 0;
	int countm = 0;
	//freopen("Input.txt", "rt", stdin);
	scanf("%ld%ld", &na, &nb);
	scanf("%ld%ld", &k, &m);
	for (int i = 0; i < na; i++)
		scanf("%ld", &A[i]);
	for (int i = 0; i < nb; i++)
		scanf("%ld", &B[i]);
	for (int i = 0; i < na; i++)
	{
		for (int j = nb - 1; j >= 0; j--)
		{
			if (B[j]>A[i])
				countm++;
			else
			{
				breaker = true;
				break;
			}
			if (countm == m)
			{
				countm = 0;
				countk++;
				break;
			}
		}
		if (breaker)
			break;
		if (countk == k)
		{
			result = true;
			break;
		}
	}
	if (result)
		printf("YES");
	else
		printf("NO");
	return 0;
}


#include "stdio.h"
#include "algorithm"
using namespace std;

#define MAX 100000

bool myfunction(long x, long B[], long nb,long m)
{
	for (int i = 0; i < nb; i++)
	{
		if (x < B[i])
		{
			if (nb - i >= m)
				return true;
		}
	}
	return false;
}
int main()
{
	long na, nb;
	long k, m;
	long A[MAX], B[MAX];
	bool result = false;
	bool breaker = false;
	int countk = 0;
	int countm = 0;

	scanf("%ld%ld", &na, &nb);
	scanf("%ld%ld", &k, &m);
	for (int i = 0; i < na; i++)
		scanf("%ld", &A[i]);
	for (int i = 0; i < nb; i++)
		scanf("%ld", &B[i]);

	int temp = 0;
	for (int i = na-1; i >= 0; i--)
	{
		temp = A[i];
		if (myfunction(A[i], B, nb, m))
		{
			result = true;
		}
		break;
	}
	if (result)
		printf("YES");
	else
		printf("NO");
	return 0;
}


#include "stdio.h"
#include "algorithm"
using namespace std;

#define MAX 100000

bool myfunction(long x, long B[], long nb,long m)
{
	for (int i = 0; i <= nb - m+1; i++)
	{
		if (x < B[i])
		{
				return true;
		}
	}
	return false;
}
int main()
{
	long na, nb;
	long k, m;
	long A[MAX], B[MAX];
	bool result = false;
	bool breaker = false;
	int countk = 0;
	int countm = 0;
	//freopen("Input.txt", "rt", stdin);
	scanf("%ld%ld", &na, &nb);
	scanf("%ld%ld", &k, &m);
	for (int i = 0; i < na; i++)
		scanf("%ld", &A[i]);
	for (int i = 0; i < nb; i++)
		scanf("%ld", &B[i]);

	int temp = -1;
	for (int i = na-1; i >= k; i--)
	{
		if (temp != A[i])
		{
			temp = A[i];
			if (myfunction(A[i], B, nb, m))
			{
				result = true;
				break;
			}
		}
	}
	if (result)
		printf("YES");
	else
		printf("NO");
	return 0;
}


#include<bits/stdc++.h>
#define mx 100005

using namespace std;
typedef long long int ll;

int main()
{
    vector< ll > a,b;

    ll i,j,k,m,na,nb,n1,n2;

    cin>>na>>nb;
    cin>>k>>m;

    a.clear();
    b.clear();

    for(i=1; i<=na; i++)
    {
        cin>>n1;
        a.push_back(n1);
    }

     for(j=1; j<=nb; j++)
    {
        cin>>n2;
        b.push_back(n2);
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());

    if(b[nb-m]>a[k-1])cout<<"YES"<<endl;
    else cout<<"NO"<<endl;

    return 0;
}


#include<bits/stdc++.h>
#define mx 100005

using namespace std;

int main()
{
    int a[mx],b[mx],na,nb,k,m;

    while(cin>>na>>nb)
    {
        memset(a, 0, sizeof a);
        memset(b, 0, sizeof b);

        int i,j;

        cin>>k>>m;

        for(i=1; i<=na; i++)
        cin>>a[i];

        for(j=1; j<=nb; j++)
        cin>>b[j];

        bool f=true;

        sort(a, a+na);
        sort(b, b+nb);

        for(i=1; i<=k; i++)
        {
            for(j=1; j<=m; j++)
            {
               if(a[i]>=b[j])
               {
                   f=false;
                   break;
               }
            }
            if(!f)break;
        }
        if(f)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#define mx 100005

using namespace std;
typedef long long int ll;

int main()
{
    vector< ll > a,b;

    ll i,j,k,m,na,nb,n1,n2;

    cin>>na>>nb;
    cin>>k>>m;

    a.clear();
    b.clear();

    for(i=1; i<=na; i++)
    {
        cin>>n1;
        a.push_back(n1);
    }

     for(j=1; j<=nb; j++)
    {
        cin>>n2;
        b.push_back(n2);
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());

    if(b[0]>a[k-1])cout<<"YES"<<endl;
    else cout<<"NO"<<endl;

    return 0;
}


#include<bits/stdc++.h>
#define mx 100005

using namespace std;
typedef long long int ll;

int main()
{
    ll a[mx],b[mx],na,nb,k,m;
    ll i,j;

    while(cin>>na>>nb)
    {
        memset(a, 0, sizeof a);
        memset(b, 0, sizeof b);

        cin>>k>>m;

        for(i=1; i<=na; i++)
        cin>>a[i];

        for(j=1; j<=nb; j++)
        cin>>b[j];

        bool f=true;

        sort(a, a+na);
        sort(b, b+nb);

        for(i=1; i<=k; i++)
        {
            for(j=1; j<=m; j++)
            {
               if(a[i]>=b[j])
               {
                   f=false;
                   break;
               }
            }
            if(!f)break;
        }
        if(f)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}


#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstring>
using namespace std;
#define ll long long
#define db double
#define FOPEN freopen("C:\\Users\\14016\\Desktop\\cad.txt","r",stdin)

bool com(char *a,char *b)
{
	if((int)*a>(int)*b) return false;
	else return true;
}
char str[200];
int main()
{
	int m;
	scanf("%d",&m);
	getchar();
	while(m--)
	{
		gets(str);
		int n=strlen(str);
		int  flag=0;
		printf("%s\n",str);
		sort(str,str+n-1,com);
		printf("%s\n",str);
		for(int i=0;i<n-1;i++)
		{
			if(abs((int)str[i]-(int)str[i+1])!=1)
			{
				flag=1;
				break;
			 }
		}
		if(flag==1) cout<<"No"<<endl;
		else cout<<"Yes"<<endl;
	}
}


#include <map>
#include <cstdio>
#include <string>
#include <cstring>
#include <cmath>
#include <vector>
#include <iostream>
#include <algorithm>

#define scad(a) scanf("%d",&a)
#define forn(i,n) for(int i=1;i<=n;i++)
#define form(i,m) for(int i=0;i<m;i++)
#define scadd(a,b) scanf("%d%d",&a,&b)
#define debug cout<<"Hello World!"<<endl;
#define scaddd(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define scadddd(a,b,c,d) scanf("%d%d%d%d".&a,&b,&c,&d)

#define INF 0x3f3f3f3f
#define maxn 200005
typedef long long ll;
using namespace std;
char s[105];
int vis[1005];
int main()
{
    int t;
    cin>>t;
    while(t--){
        scanf("%s",s);
        int flag=0;
        memset(vis,0,sizeof(vis));
        int mmin=1006;
        for(int i=0;i<strlen(s);i++)
        {
            if(vis[s[i]])
            {
                flag=1;
                break;
            }
            else vis[s[i]]=1;
            mmin=min((int)s[i],mmin);
        }
        if(flag) cout<<"No"<<endl;
        else
        {
            flag=1;
            for(int i=mmin;i<mmin+strlen(s);i++)
            {
                if(!vis[i]) flag=0;
            }
            if(strlen(s)==1) flag=1;
            if(flag) cout<<"Yes"<<endl;
            else cout<<"No"<<endl;
        }
    }
    return 0;
}


#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstring>
using namespace std;
#define ll long long
#define db double
#define FOPEN freopen("C:\\Users\\14016\\Desktop\\cad.txt","r",stdin)

bool com(char a,char b)
{
	if((int)a>(int)b) return false;
	else return true;
}
char str[200];
int main()
{

	int m;
	scanf("%d",&m);
	getchar();
	while(m--)
	{
		scanf("%s",str);
		int n=strlen(str);
		int  flag=0;
		sort(str,str+n,com);
		int i;
		for(i=0;i<n-1;i++)
		{
			if(abs((int)str[i]-(int)str[i+1])!=1)
			{
				flag=1;
				break;
			 }
		}
		if(flag==1) cout<<"No"<<endl;
		else cout<<"Yes"<<endl;
	}
}


#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstring>
using namespace std;
#define ll long long
#define db double
#define FOPEN freopen("C:\\Users\\14016\\Desktop\\cad.txt","r",stdin)
char str[200];
bool com(int a,int b)
{
	return (int)str[a]<(int)str[b];
}
int index[1005];
int main()
{
	int m;
	cin>>m;
	getchar();
	while(m--)
	{
		scanf("%s",str);
		int n=strlen(str);
		int  flag=0;
		for(int i=0;i<n;i++)
		{
			index[i]=i;;
		}
		sort(index,index+n,com);
		register int i;
		for(i=0;i<n-1;i++)
		{
			//cout<<str[i]<<endl;
			if(abs(str[index[i]]-str[index[i+1]])!=1)
			{
				flag=1;
				break;
			 }
		}
		if(flag==1) cout<<"No"<<endl;
		else cout<<"Yes"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,f=0;
    cin>>n;
    while(n--)
    {
        string s;
        cin>>s;
        sort(s.begin(), s.end());
        for(int i=0; i<s.length(); i++)
        {
            if(s[i]!=s[i+1]-1)
            {
                f=1;
                break;
            }
        }
        if(f==0)
        {
            cout<<"YES\n";
        }
        else{
            cout<<"NO\n";
        }

    }
    return 0;
}


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

bool isDiverse(string st){
    set<char> s;
    list<char> l;
    vector<char> v;

    for(int i=0;i<st.length();i++)
    s.insert(st.at(i));

    for(int i=0;i<st.length();i++)
    l.pb(st.at(i));

    l.sort();

    if(s.size()!=l.size())
    return false;

    list<char>::iterator it;

    for(it=l.begin(); it != l.end(); ++it)
    v.pb(*it);

    int count=0;
    for(int i=0;i<v.size()-1;i++){

        int j= (int)v.at(i);
        int k = (int)v.at(i+1);

        if((j+1)==k)
        count++;
    }

    if((count+1)==v.size())
    return true;
    else
    return false;
}

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
	cin>>n;

	for(int i=0;i<n;i++){
	    string s;
	    cin>>s;
	    bool k = isDiverse(s);

	    if(k)
	    cout<<"YES"<<endl;
	    else
	    cout<<"NO"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,f=0;
    cin>>n;
    while(n--)
    {
        string s;
        cin>>s;
        sort(s.begin(), s.end());
        for(int i=0; i<s.length(); i++)
        {
            if(s[i]!=s[0]+i)
            {
                f=1;
                break;
            }
        }
        if(f==0)
        {
            cout<<"YES\n";
        }
        else{
            cout<<"NO\n";
        }

    }
    return 0;
}


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

bool isDiverse(string st){
    set<char> s;
    list<char> l;
    vector<char> v;

    for(int i=0;i<st.length();i++)
    s.insert(st.at(i));

    for(int i=0;i<st.length();i++)
    l.pb(st.at(i));

    l.sort();

    if(s.size()!=l.size())
    return false;

    list<char>::iterator it;

    for(it=l.begin(); it != l.end(); ++it)
    v.pb(*it);

    int count=0;
    for(int i=0;i<v.size()-1;i++){

        int j= (int)v.at(i);
        int k = (int)v.at(i+1);

        if((j+1)==k)
        count++;
    }

    if((count+1)==v.size())
    return true;
    else
    return false;
}

int main(){

    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);

    int n;
	cin>>n;

	for(int i=0;i<n;i++){
	    string s;
	    cin>>s;
	    bool k = isDiverse(s);

	    if(k)
	    cout<<"YES"<<endl;
	    else
	    cout<<"NO"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,f=0;
    cin>>n;
    while(n--)
    {
        string s;
        cin>>s;
        for(int i=0; i<s.length(); i++)
        {
            for(int j=0; j<s.length()-i-1; j++)
            {
                if(s[j]>s[j+1])
                {
                    char temp=s[j];
                    s[j]=s[j+1];
                    s[j+1]=temp;
                }
            }
        }
        for(int j=0; j<s.length()-1; j++)
        {
            if(s[j]==s[j+1])
            {
                f=1;
                break;
            }
            else if(s[j+1]!=s[j]+1)
            {
                f=1;
                break;
            }
        }
        if(f==0)
        {
            cout<<"YES\n";
        }
        else{
            cout<<"NO\n";
        }

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,f=0;
    cin>>n;
    while(n--)
    {
        string s;
        cin>>s;
        sort(s.begin(), s.end());
        bool flag=true;
        for(int i=0; i<s.length(); i++)
        {
            if(s[i]!=s[i+1]-1)
            {
                flag=false;
            }
        }
        if(flag)
        {
            cout<<"YES\n";
        }
        else{
            cout<<"NO\n";
        }

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,f=0;
    cin>>n;
    while(n--)
    {
        string s;
        cin>>s;
        sort(s.begin(), s.end());
        bool flag=true;
        for(int i=0; i<s.size()-1; i++)
        {
            if(s[i]!=s[i+1]-1)
            {
                flag=false;
            }
        }
        if(flag)
        {
            cout<<"YES\n";
        }
        else{
            cout<<"NO\n";
        }

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,f=0;
    cin>>n;
    while(n--)
    {
        string s;
        cin>>s;
        for(int i=0; i<s.length(); i++)
        {
            for(int j=0; j<s.length()-i-1; j++)
            {
                if(s[j]>s[j+1])
                {
                    char temp=s[j];
                    s[j]=s[j+1];
                    s[j+1]=temp;
                }
            }
        }
        for(int i=0; i<s.length(); i++)
        {
            if(s[i]!=s[0]+i)
            {
                f=1;
                break;
            }
        }
        if(f==0)
        {
            cout<<"YES\n";
        }
        else{
            cout<<"NO\n";
        }

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t,i;
	cin>>t;
	int freq[26];
	while(t--)
	{
		memset(freq,0,sizeof(freq));
		int flag=1;
		string s;
		cin>>s;
		for(i=0;i<s.length()-1;i++)
		{
			freq[s[i]-97]++;
			if(s[i]-s[i+1]==1||s[i+1]-s[i]==1)
			{
				flag=1;

				continue;
			}
			flag=0;
		}
		freq[s[i]-97]++;
		for(i=0;i<26;i++)
		{
			if(freq[i]>1)
				flag=0;
		}
		if(flag==1)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t,i;
	cin>>t;
	int freq[26];
	while(t--)
	{
		memset(freq,0,sizeof(freq));
		int flag=0;
		string s;
		cin>>s;
		for(i=0;i<s.length()-1;i++)
		{
			freq[s[i]-97]++;
			if(s[i+1]-s[i]==1)
			{
				flag=1;
				continue;
			}

		}
		freq[s[i]-97]++;
		for(i=0;i<26;i++)
		{
			if(freq[i]>1)
				flag=0;
		}
		if(flag==1)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t,i;
	cin>>t;
	int freq[26];
	while(t--)
	{
		memset(freq,0,sizeof(freq));
		int flag=1;
		string s;
		cin>>s;
		for(i=0;i<s.length()-1;i++)
		{
			freq[s[i]-97]++;
			if(s[i]-s[i+1]==1||s[i+1]-s[i]==1)
			{
				flag=1;

				continue;
			}
			flag=0;
			break;
		}
		freq[s[i]-97]++;
		for(i=0;i<26;i++)
		{
			if(freq[i]>1)
				flag=0;
		}
		if(flag==1)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t,i;
	cin>>t;
	int freq[26];
	while(t--)
	{
		memset(freq,0,sizeof(freq));
		int flag=1;
		string s;
		cin>>s;
		for(i=0;i<s.length()-1;i++)
		{
			if(s[i]-s[i+1]==1||s[i+1]-s[i]==1)
			{
				flag=1;
				freq[s[i]-97]++;
				continue;
			}
			flag=0;
		}
		freq[s[i]-97]++;
		for(i=0;i<26;i++)
		{
			if(freq[i]>1)
				flag=0;
		}
		if(flag==1)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t,i;
	cin>>t;
	int freq[26];
	while(t--)
	{
		memset(freq,0,sizeof(freq));
		int flag=0;
		string s;
		cin>>s;
		for(i=0;i<s.length()-1;i++)
		{
			freq[s[i]-97]++;
		}
		freq[s[i]-97]++;
		for(i=0;i<26;i++)
		{

			if(freq[i]>1)
				flag=0;
		}
		if(flag!=0)
		{
			for(i=0;i<26;i++)
			{
				if(freq[i]==1)
					break;
			}
			for(int j=0;j<s.length();j++)
			{
				if(freq[i+j]!=1)
					flag=0;
			}
		}
		if(flag==1)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t,i;
	cin>>t;
	int freq[26];
	while(t--)
	{
		memset(freq,0,sizeof(freq));
		int flag=0;
		string s;
		cin>>s;
		for(i=0;i<s.length()-1;i++)
		{
			freq[s[i]-97]++;
			if(s[i]-s[i+1]==1||s[i+1]-s[i]==1)
			{
				flag=1;
				continue;
			}

		}
		freq[s[i]-97]++;
		for(i=0;i<26;i++)
		{
			if(freq[i]>1)
				flag=0;
		}
		if(flag==1)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t,i;
	cin>>t;
	int freq[26];
	while(t--)
	{
		memset(freq,0,sizeof(freq));
		int flag=1;
		string s;
		cin>>s;
		for(i=0;i<s.length()-1;i++)
		{
			freq[s[i]-97]++;
		}
		freq[s[i]-97]++;
		for(i=0;i<26;i++)
		{

			if(freq[i]>1)
			{
				//cout<<p;
				flag=0;
			}
		}
		if(flag!=0)
		{
			for(i=0;i<26;i++)
			{
				if(freq[i]==1)
					break;
			}
			for(int j=0;j<s.length();j++)
			{
				if(freq[i+j]!=1)
				{
					//cout<<freq[i+j];
					flag=0;
				}
			}
		}
		if(flag==1)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
}


#include <bits/stdc++.h>

using namespace std;

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

	int a[26];
	int yn=0;

	int n=0;
	cin >> n;

	for(int i=0; i<n; i++){
		string l = "";
		cin >> l;

		for (int q=0; q<26; q++){
			a[i]=0;
		}
		yn=0;

		for(int j=0; j<l.length(); j++){
			int k;
			k = (int(l[j]))%97;
			a[k]++;
		}

		for (int q=0; q<26; q++){
			if(a[q]==2) yn=1;
		}

		sort(l.begin(),l.end());

		if(yn==0){
			for(int p=0; p<l.length(); p++){
				if( ( int(l[p+1]) - int(l[p]) )> 1){
					yn=1;
				}
			}
		}

		if(yn==0) cout << "Yes" << endl;
		else if(yn==1) cout << "No" << endl;
	}

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

	int a[26];
	int yn=0;

	int n=0;
	cin >> n;

	for(int i=0; i<n; i++){
		string l = "";
		cin >> l;

		for (int q=0; q<26; q++){
			a[q]=0;
		}
		yn=0;

		for(int j=0; j<l.length(); j++){
			int k;
			k = (int(l[j]))%97;
			a[k]++;
		}

		for (int q=0; q<26; q++){
			if(a[q]>=2) yn=1;
		}

		sort(l.begin(),l.end());

		if(yn==0){
			for(int p=0; p<l.length(); p++){
				if( ( int(l[p+1]) - int(l[p]) )> 1){
					yn=1;
				}
			}
		}

		if(yn==0) cout << "Yes" << endl;
		else if(yn==1) cout << "No" << endl;
	}

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

	int a[26] = {0};
	int yn=0;

	int n=0;
	cin >> n;

	for(int i=0; i<n; i++){
		string l = "";
		cin >> l;

		for (int q=0; q<26; q++){
			a[i]=0;
		}

		yn=0;

		for(int j=0; j<l.length(); j++){
			int k;
			k = (int(l[j]))%97;
			a[k]++;
			if(a[k]==2){
				yn=1;
			}
		}

		sort(l.begin(),l.end());

		if(yn==0){
			for(int p=0; p<l.length(); p++){
				if( ( int(l[p+1]) - int(l[p]) )> 1){
					yn=1;
				}
			}
		}

		if(yn==0) cout << "Yes" << endl;
		else if(yn==1) cout << "No" << endl;
	}

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

	int a[26];
	int yn=0;

	int n=0;
	cin >> n;

	for(int i=0; i<n; i++){
		string l = "";
		cin >> l;

		for (int q=0; q<26; q++){
			a[q]=0;
		}
		yn=0;

		cout << yn << endl;

		for(int j=0; j<l.length(); j++){
			int k;
			k = (int(l[j]))%97;
			a[k]++;
		}

		for (int q=0; q<26; q++){
			cout << a[q] <<endl;
			if(a[q]==2) yn=1;
		}

		sort(l.begin(),l.end());

		if(yn==0){
			for(int p=0; p<l.length(); p++){
				if( ( int(l[p+1]) - int(l[p]) )> 1){
					yn=1;
				}
			}
		}

		if(yn==0) cout << "Yes" << endl;
		else if(yn==1) cout << "No" << endl;
	}

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

	int a[26] = {0};
	int yn[1]={0};
	int n;
	cin >> n;

	for(int i=0; i<n; i++){
		string l;
		cin >> l;
		a[26]={0};
		yn[0]={0};
		for(int j=0; j<l.length(); j++){
			int k;
			k = int(l[j])%97;
			a[k]++;
			if(a[k]==2) {
				cout << "No" << endl;
				yn[0]=1;
				break;
			}
		}
		if(yn[0]==0) cout << "Yes" << endl;
	}

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

	int a[26];
	int yn=0;

	int n=0;
	cin >> n;

	for(int i=0; i<n; i++){
		string l = "";
		cin >> l;

		for (int q=0; q<26; q++){
			a[i]=0;
		}
		yn=0;

		for(int j=0; j<l.length(); j++){
			int k;
			k = (int(l[j]))%97;
			a[k]++;
		}

		for (int q=0; q<26; q++){
			if(a[i]==2) yn=1;
		}

		sort(l.begin(),l.end());

		if(yn==0){
			for(int p=0; p<l.length(); p++){
				if( ( int(l[p+1]) - int(l[p]) )> 1){
					yn=1;
				}
			}
		}

		if(yn==0) cout << "Yes" << endl;
		else if(yn==1) cout << "No" << endl;
	}

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

	int a[26] = {0};
	int yn[1]={0};
	int n=0;
	cin >> n;

	for(int i=0; i<n; i++){
		string l;
		cin >> l;
		a[26]={0};
		yn[0]={0};
		for(int j=0; j<l.length(); j++){
			int k;
			k = int(l[j])%97;
			a[k]++;
			if(a[k]==2) {
				cout << "No" << endl;
				yn[0]=1;
				break;
			}
		}

		sort(l.begin(),l.end());

		if(yn[0]==0){
			for(int j=0; j<l.length()-1; j++){
				if(int(l[j+1])-int(l[j]) < 1){
					cout << "No" << endl;
					yn[0]=1;
					break;
				}
			}
		}

		if(yn[0]==0) cout << "Yes" << endl;
	}

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

	int a[26] = {0};
	int yn[1]={0};
	int n=0;
	cin >> n;

	for(int i=0; i<n; i++){
		string l;
		cin >> l;
		a[26]={0};
		yn[0]={0};
		for(int j=0; j<l.length(); j++){
			int k;
			k = int(l[j])%97;
			a[k]++;
			if(a[k]==2) {
				cout << "No" << endl;
				yn[0]=1;
				break;
			}
		}

		sort(l.begin(),l.end());

		for(int j=0; j<l.length()-1; j++){
			if(int(l[j+1])-int(l[j]) < 1){
				cout << "No" << endl;
				yn[0]=1;
				break;
			}
		}

		if(yn[0]==0) cout << "Yes" << endl;
	}

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

	int a[26];
	int yn=0;

	int n=0;
	cin >> n;

	for(int i=0; i<n; i++){
		string l = "";
		cin >> l;

		for (int q=0; q<26; q++){
			a[q]=0;
		}
		yn=0;

		for(int j=0; j<l.length(); j++){
			int k;
			k = (int(l[j]))%97;
			a[k]++;
		}

		for (int q=0; q<26; q++){
			if(a[q]==2) yn=1;
		}

		sort(l.begin(),l.end());

		if(yn==0){
			for(int p=0; p<l.length(); p++){
				if( ( int(l[p+1]) - int(l[p]) )> 1){
					yn=1;
				}
			}
		}

		if(yn==0) cout << "Yes" << endl;
		else if(yn==1) cout << "No" << endl;
	}

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

	int a[26] = {0};
	int yn[1]={0};
	int n=0;
	cin >> n;

	for(int i=0; i<n; i++){
		string l;
		cin >> l;
		a[26]={0};
		yn[0]={0};
		for(int j=0; j<l.length(); j++){
			int k;
			k = int(l[j])%97;
			a[k]++;
			if(a[k]==2) {
				cout << "No" << endl;
				yn[0]=1;
				break;
			}
		}

		sort(l.begin(),l.end());

		if(yn[0]==0){
			for(int j=0; j<l.length(); j++){
				if(int(l[j+1])-int(l[j]) > 1){
					cout << "No" << endl;
					yn[0]=1;
					break;
				}
			}
		}

		if(yn[0]==0) cout << "Yes" << endl;
	}

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

	int a[26] = {0};
	int yn=0;

	int n=0;
	cin >> n;

	for(int i=0; i<n; i++){
		string l = "";
		cin >> l;
		a[26]={0};
		yn=0;

		for(int j=0; j<l.length(); j++){
			int k;
			k = (int(l[j]))%97;
			a[k]++;
			if(a[k]==2){
				yn=1;
			}
		}

		sort(l.begin(),l.end());

		if(yn==0){
			for(int j=0; j<l.length(); j++){
				if(int(l[j+1])-int(l[j]) > 1){
					yn=1;
				}
			}
		}

		if(yn==0) cout << "Yes" << endl;
		else if(yn==1) cout << "No" << endl;
	}

   return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int t ;
	cin >> t ;
	string str[t] ;
	for ( int i = 0 ; i < t ; i++ )
	{
		string s ;
		cin >> s ;
		sort ( s.begin() , s.end() ) ;
		int l = s.length() - 1 ;
		int x = s[l] - s[0] ;
		if ( x == l )
			str[i] = "yes" ;
		else
			str[i] = "no" ;
	}
	for ( int i = 0 ; i < t ; i++ )
		cout << str[i] << endl ;
	return 0 ;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int t ;
	cin >> t ;
	string str[t] ;
	for ( int i = 0 ; i < t ; i++ )
	{
		string s ;
		cin >> s ;
		sort ( s.begin() , s.end() ) ;
		int l = s.length() - 1 ;
		int cc = 0 ;
		for ( int x = 1 ; x <= l ; x++ )
			if ( s[x] != s[x-1] )
				cc++ ;
		if ( l == cc )
			str[i] = "yes" ;
		else
			str[i] = "no" ;
	}
	for ( int i = 0 ; i < t ; i++ )
		cout << str[i] << endl ;
	return 0 ;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int t ;
	cin >> t ;
	string str[t] ;
	for ( int i = 0 ; i < t ; i++ )
	{
		string s ;
		cin >> s ;
		sort ( s.begin() , s.end() ) ;
		int l = s.length() - 1 ;
		int cc = 1 ;
		for ( int x = 1 ; x <= l ; x++ )
			if ( s[x] != s[x-1] )
				cc++ ;
		if ( l == cc )
			str[i] = "yes" ;
		else
			str[i] = "no" ;
	}
	for ( int i = 0 ; i < t ; i++ )
		cout << str[i] << endl ;
	return 0 ;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int t ;
	cin >> t ;
	string str[t] ;
	for ( int i = 0 ; i < t ; i++ )
	{
		string s ;
		cin >> s ;
		sort ( s.begin() , s.end() ) ;
		int l = s.length() - 1 ;
		int cc = 1 ;
		for ( int x = 1 ; x <= l ; x++ )
			if ( s[x] != s[x-1] )
				cc+ ;
		if ( l == cc )
			str[i] = "yes" ;
		else
			str[i] = "no" ;
	}
	for ( int i = 0 ; i < t ; i++ )
		cout << str[i] << endl ;
	return 0 ;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int t ;
	cin >> t ;
	string str[t] ;
	for ( int i = 0 ; i < t ; i++ )
	{
		string s ;
		cin >> s ;
		sort ( s.begin() , s.end() ) ;
		int l = s.length() - 1 ;
		int cc = 0 ;
		int a = s[l] - s[0] ;
		for ( int x = 1 ; x <= l ; x++ )
			if ( s[x] != s[x-1] )
				cc++ ;
		if ( l == cc && l == a )
			str[i] = "yes" ;
		else
			str[i] = "no" ;
	}
	for ( int i = 0 ; i < t ; i++ )
		cout << str[i] << endl ;
	return 0 ;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,p=0;
string S;
cin>>n;
for(int i=0;i<n;++i)
{
    cin>>S;
    if(S.size()==1) {cout<<"Yes"<<endl;}
    else
    {for(int a=1;a<S.size();++a)
        for(int b=0;b<S.size()-a;++b)
        if(S[b]>S[b+1]) swap(S[b],S[b+1]);
    for(int j=0;j<S.size();++j)
    if(S[i]!=S[i+1]-1) {cout<<"No"<<endl;p=1;j=S.size();}
    if(p==0) cout<<"Yes"<<endl;
    else p=0;}
}
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,p=0;
string S;
cin>>n;
for(int i=0;i<n;++i)
{
    cin>>S;
    if(S.size()==1) {cout<<"Yes"<<endl;}
    else
    {for(int a=1;a<S.size();++a)
        for(int b=0;b<S.size()-a;++b)
        if(S[b]>S[b+1]) swap(S[b],S[b+1]);
    for(int j=0;j<S.size()-1;++j)
    if(S[i]!=S[i+1]-1) {cout<<"No"<<endl;p=1;j=S.size();}
    if(p==0) cout<<"Yes"<<endl;
    else p=0;}
}
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,p=0;
string S;
cin>>n;
for(int i=0;i<n;++i)
{
    cin>>S;
    if(S.size()==1) {cout<<"Yes"<<endl;}
    else
    {for(int a=1;a<S.size();++a)
        for(int b=0;b<S.size()-a;++b)
        if(S[b]>S[b+1]) swap(S[b],S[b+1]);
    for(int j=0;j<S.size();++j)
    if(S[i]<S[i+1]-1) {cout<<"No"<<endl;p=1;j=S.size();}
    if(p==0) cout<<"Yes"<<endl;
    else p=0;}
}
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,p=0;
string S;
cin>>n;
for(int i=0;i<n;++i)
{
    cin>>S;
    for(int a=1;a<S.size();++a)
        for(int b=0;b<S.size()-a;++b)
        if(S[b]>S[b+1]) swap(S[b],S[b+1]);
    for(int j=0;j<S.size();++j)
    if(S[i]!=S[i+1]-1) {cout<<"NO"<<endl;p=1;j=S.size;}
    if(p==0) cout<<"YES"<<endl;
    else p=0;
}
}