#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main()
{

	int n;
	cin >> n;
	vector<int> a;
	vector<int> b;

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

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

	int l = 0;
	int r = n - 1;

	int check = 0;
	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			check = 1;
		}
	}

	if (check == 0)
	{
		cout << "yes" <<endl;
		cout << 1 <<" " << n - 1;
		return 0;
	}

	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] != b[i])
		{
			l = i;
			break;
		}
	}

	for (int j = n  - 1; j >= 0; j--)
	{
		if (a[j] != b[j])
		{
			r = j;
			break;
		}
	}

	int i, j;
	for (i = l, j = r; i < n && j > 0 && i != j ; i++ , j--)
	{
		swap(b[i], b[j]);
	}

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			cout << "no";
			return 0;
		}
	}

	cout << "yes" << endl;
	cout << l + 1 << " " << r + 1;

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main()
{

	int n;
	cin >> n;
	vector<int> a;
	vector<int> b;

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

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

	int l = 0;
	int r = n - 1;

	int check = 0;
	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			check = 1;
		}
	}

	if (check == 0)
	{
		cout << "yes" <<endl;
		cout << 1 <<" " << n - 1;
		return 0;
	}

	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] != b[i])
		{
			l = i;
			break;
		}
	}

	for (int j = n  - 1; j >= 0; j--)
	{
		if (a[j] != b[j])
		{
			r = j;
			break;
		}
	}

	int i, j;
	for (i = l, j = r; i <= l && j > 0 && i != j ; i++ , j--)
	{
		swap(b[i], b[j]);
	}

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			cout << "no";
			return 0;
		}
	}

	cout << "yes" << endl;
	cout << l + 1 << " " << r + 1;

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main()
{

	int n;
	cin >> n;
	vector<int> a;
	vector<int> b;

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

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

	int l = 0;
	int r = n - 1;

	int check = 0;
	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			check = 1;
		}
	}

	if (check == 0)
	{
		cout << "yes" <<endl;
		cout << 1 <<" " << n - 1;
		return 0;
	}

	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] != b[i])
		{
			l = i;
			break;
		}
	}

	for (int j = n  - 1; j >= 0; j--)
	{
		if (a[j] != b[j])
		{
			r = j;
			break;
		}
	}

	int i, j;
	for (i = l, j = r; i < j; i++ , j--)
	{
		swap(b[i], b[j]);
	}

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			cout << "no";
			return 0;
		}
	}

	cout << "yes" << endl;
	cout << l + 1 << " " << r + 1;

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

void Swap(int &x, int &y)
{
	int temp  =x;
	x = y;
	y = temp;
}

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

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

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

	int l = 0, r = 0;

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			l = i;
			break;
		}
	}

	for (int i = n - 1; i >= 0; i--)
	{
		if (a[i] != b[i])
		{
			r = i;
			break;
		}
	}
	int i, j;
	for (i = l, j = r; i < j; i++, j--)
	{
		Swap(b[i], b[j]);
	}

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			cout <<"no";
			return 0;
		}
	}

	cout <<"yes\n";
	cout << l + 1 <<" " << r + 1;

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

void Swap(int &x, int &y)
{
	int temp  =x;
	x = y;
	y = temp;
}
int main()
{
	int n;
	cin >> n;

	vector<int> a,b;

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

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

	int l = 0, r = 0;

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			l = i;
			break;
		}
	}

	for (int i = n - 1; i >= 0; i--)
	{
		if (a[i] != b[i])
		{
			r = i;
			break;
		}
	}
	int i, j;
	for (i = l, j = r; i < j; i++, j--)
	{
		Swap(b[i], b[j]);
	}

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			cout <<"no";
			return 0;
		}
	}

	cout <<"yes\n";
	cout << l + 1 <<" " << r + 1;

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

void Swap(int &x, int &y)
{
	int temp  =x;
	x = y;
	y = temp;
}

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

	vector<int> a,b;

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

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

	int l = 0, r = 0;

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			l = i;
			break;
		}
	}

	for (int i = n - 1; i >= 0; i--)
	{
		if (a[i] != b[i])
		{
			r = i;
			break;
		}
	}
	int i, j;
	for (i = l, j = r; i < j; i++, j--)
	{
		Swap(b[i], b[j]);
	}

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			cout <<"no";
			return 0;
		}
	}

	cout <<"yes\n";
	cout << l + 1 <<" " << r + 1;

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main()
{

	int n;
	cin >> n;
	vector<int> a;
	vector<int> b;

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

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

	int l = 0;
	int r = n - 1;

	int check = 0;
	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			check = 1;
		}
	}

	if (check == 0)
	{
		cout << "yes" <<endl;
		cout << 1 <<" " << n - 1;
		return 0;
	}

	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] != b[i])
		{
			l = i;
			break;
		}
	}

	for (int j = n  - 1; j >= 0; j--)
	{
		if (a[j] != b[j])
		{
			r = j;
			break;
		}
	}

	int i, j;
	for (i = 0, j = r; i <= l && j >= 0 && i != j ; i++ , j--)
	{
		swap(b[i], b[j]);
	}

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			cout << "no";
			return 0;
		}
	}

	cout << "yes" << endl;
	cout << l + 1 << " " << r + 1;

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main()
{

	int n;
	cin >> n;
	vector<int> a;
	vector<int> b;

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

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

	int l = 0;
	int r = n - 1;

	int check = 0;
	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			check = 1;
		}
	}

	if (check == 0)
	{
		cout << "yes" <<endl;
		cout << 1 <<" " << n - 1;
		return 0;
	}

	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] != b[i])
		{
			l = i;
			break;
		}
	}

	for (int j = n  - 1; j >= 0; j--)
	{
		if (a[j] != b[j])
		{
			r = j;
			break;
		}
	}

	int i, j;
	for (i = 0, j = r; i <= l && j > 0 && i != j ; i++ , j--)
	{
		swap(b[i], b[j]);
	}

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			cout << "no";
			return 0;
		}
	}

	cout << "yes" << endl;
	cout << l + 1 << " " << r + 1;

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main()
{

	int n;
	cin >> n;
	vector<int> a;
	vector<int> b;

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

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

	int l = 0;
	int r = n - 1;

	int check = 0;
	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			check = 1;
		}
	}

	if (check == 0)
	{
		cout << "yes";
		cout << 1 <<" " << n - 1;
		return 0;
	}

	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] != b[i])
		{
			l = i;
			break;
		}
	}

	for (int j = n  - 1; j >= 0; j--)
	{
		if (a[j] != b[j])
		{
			r = j;
			break;
		}
	}

	int i, j;
	for (i = 0, j = r; i <= l && j >= 0 ; i++ , j--)
	{
		swap(b[i], b[j]);
	}

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			cout << "no";
			return 0;
		}
	}

	cout << "yes" << endl;
	cout << l + 1 << " " << r + 1;

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main()
{

	int n;
	cin >> n;
	vector<int> a;
	vector<int> b;

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

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

	int l = 0;
	int r = 0;

	int check = 0;
	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			check = 1;
		}
	}

	if (check == 0)
	{
		cout << "yes" <<endl;
		cout << 1 <<" " << n - 1;
		return 0;
	}

	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] != b[i])
		{
			l = i;
			break;
		}
	}

	for (int j = n  - 1; j >= 0; j--)
	{
		if (a[j] != b[j])
		{
			r = j;
			break;
		}
	}

	int i, j;
	for (i = l, j = r; i < j; i++ , j--)
	{
		swap(b[i], b[j]);
	}

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			cout << "no";
			return 0;
		}
	}

	cout << "yes" << endl;
	cout << l + 1 << " " << r + 1;

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main()
{

	int n;
	cin >> n;
	vector<int> a;
	vector<int> b;

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

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

	int l = 0;
	int r = n - 1;

	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] != b[i])
		{
			l = i;
			break;
		}
	}

	for (int j = n  - 1; j >= 0; j--)
	{
		if (a[j] != b[j])
		{
			r = j;
			break;
		}
	}

	int i, j;
	for (i = 0, j = r; i <= l && j >= 0 ; i++ , j--)
	{
		swap(b[i], b[j]);
	}

	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			cout << "no";
			return 0;
		}
	}
	cout << "yes" << endl;
	cout << l + 1 << " " << r + 1;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define ull unsigned long long
#define pi 3.141592654
#define F first
#define S second
#define pb push_back
#define endl '\n'
#define all(v)			((v).begin()), ((v).end())
#define rall(v)			((v).rbegin()), ((v).rend())
#define sz(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
void me()
{
	ios::sync_with_stdio(0);
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
}
vector<int> v, vec;
bool check(vector <int> v)
{
	for (int i = 0; i < v.size(); i++)
		if (v[i]!=vec[i])
			return false;
	return true;
}
int main()
{
	me();
	int n, x= -1, y=-1 ;
	cin >> n;
	vec = v = vector<int>(n);
	vector <int> f(n);
	for (int i = 0; i < n; i++)
	{
		cin >> v[i];
		vec[i] = v[i];
	}
	sort(all(vec));
	if (check(v)) return cout << "yes" << endl << 1 << ' ' << 1 << endl, 0;
	for (int i = 0; i < n; i++)
	{
		if (v[i] != vec[i])
		{
			x = i + 1;
			break;
		}
	}
	for (int i = n - 1; i >= 0; i--)
	{
		if (v[i] != vec[i])
		{
			y = i + 1;
			break;
		}
	}
	for (int i = 0; i < n; i++)
	{
		if (i == x - 1)
		{
			for (int j = y - 1, k = x - 1; j >= x-1 ; j--, k++)
				f[k] = v[j];
				i += (y - x);
		}
		else
			f[i] = v[i];
	}
	/*for (auto i : f)
		cout << i << ' '; cout << endl;*/
	if (check(f)) cout << "yes" << endl << x << ' ' << y << endl;
	else cout << "no" << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,x,y,c=0;
    bool check=false,check2=1;
    cin >> n; ll a[n],b[n];
    for ( ll i=0 ; i<n ; i++ ){ cin >> a[i]; b[i]=a[i];}
    sort(b,b+n);
    for ( ll i=0 ; i<n ; i++ )
    {
        if ( a[i]!=b[i]){ check2=0; break;}
    }
    if (check2){cout << "yes" << endl << 1 << ' ' << 1 << endl; return 0;}
    for ( ll i=0 ; i<n ; i++ )
    {
        if (a[i]!=b[i] && check==false ){check=true; x=i;}
        else if (check==true && a[i]!=b[i]){y=i; break;}
    }
    swap ( a[x],a[y]);
    for ( ll i=0 ; i<n ; i++ )if (a[i]!=b[i])c++;
    (c==0)? cout << "yes" << endl << x+1 << ' ' << y+1 << endl : cout << "no" << endl ;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,x=0,y=0;
    bool check=0,check2=1;
    cin >> n; ll a[n],b[n],z[n];
    for ( ll i=0 ; i<n ; i++ ){ cin >> a[i]; b[i]=a[i]; z[i]=a[i];}
    sort(b,b+n);
    for ( ll i=0 ; i<n ; i++ ) if ( check==0 && a[i]!=b[i] ){x=i; check=0; break;}
    for ( ll i=n-1 ; i>=0 ; i-- ) if ( check==0 && a[i]!=b[i] ){y=i; break;}
    for ( ll i=y,j=x ; j<=y ; i-- ){ z[j]=a[i]; j++;}
    for ( ll i=0 ; i<n ; i++ ) if ( z[i]!=b[i] ){check2=0; break;}
    if (check2==1 || z[y]==b[1]) cout << "yes" << endl << x+1 << ' ' << y+1 << endl;
    else cout << "no" << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    ll n,x=0,y=0;
    bool check=0,check2=1;
    cin >> n; ll a[n],b[n],z[n];
    for ( ll i=0 ; i<n ; i++ ){ cin >> a[i]; b[i]=a[i]; z[i]=a[i];}
    sort(b,b+n);
    for ( ll i=0 ; i<n ; i++ ) if ( check==0 && a[i]!=b[i] ){x=i; check=0; break;}
    for ( ll i=n-1 ; i>=0 ; i-- ) if ( check==0 && a[i]!=b[i] ){y=i; break;}
    for ( ll i=y,j=x ; j<=y ; i-- ){ z[j]=a[i]; j++;}
    for ( ll i=0 ; i<n ; i++ ) if ( z[i]!=b[i] ){check2=0; break;}
    if (check2==1 ) cout << "yes" << endl << x+1 << ' ' << y+1 << endl;
    else cout << "no" << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,x=0,y=0;
    bool check=0,check2=1;
    cin >> n; ll a[n],b[n],z[n];
    for ( ll i=0 ; i<n ; i++ ){ cin >> a[i]; b[i]=a[i]; z[i]=a[i];}
    sort(b,b+n);
    for ( ll i=0 ; i<n ; i++ ) if ( check==0 && a[i]!=b[i] ){x=i; check=0; break;}
    for ( ll i=n-1 ; i>=0 ; i-- ) if ( check==0 && a[i]!=b[i] ){y=i; break;}
    for ( ll i=x ; i<=y/2 ; i++ )swap(z[i],z[y-i]);
    for ( ll i=0 ; i<n ; i++ ) if ( z[i]!=b[i] ){check2=0; break;}
    if (check2==1 || z[y]==b[1]) cout << "yes" << endl << x+1 << ' ' << y+1 << endl;
    else cout << "no" << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,x=0,y=0;
    bool check=0,check2=1;
    cin >> n; ll a[n],b[n],z[n];
    for ( ll i=0 ; i<n ; i++ ){ cin >> a[i]; b[i]=a[i]; z[i]=a[i];}
    sort(b,b+n);
    for ( ll i=0 ; i<n ; i++ ) if ( check==0 && a[i]!=b[i] ){x=i; check=0; break;}
    for ( ll i=n-1 ; i>=0 ; i-- ) if ( check==0 && a[i]!=b[i] ){y=i; break;}
    for ( ll i=x ; i<=y/2 ; i++ )swap(z[i],z[y-i]);
    for ( ll i=0 ; i<n ; i++ ) if ( z[i]!=b[i] ){check2=0; break;}
    (check2)? cout << "yes" << endl << x+1 << ' ' << y+1 << endl : cout << "no" << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define ull unsigned long long
#define pi 3.141592654
#define F first
#define S second
#define pb push_back
#define endl '\n'
#define all(v)			((v).begin()), ((v).end())
#define rall(v)			((v).rbegin()), ((v).rend())
#define sz(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
void me()
{
	ios::sync_with_stdio(0);
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
}
vector<int> v, vec;
bool check()
{
	for (int i = 0; i < v.size(); i++)
		if (v[i]!=vec[i])
			return false;
	return true;
}
int main()
{
	me();
	int n, x= -1, y=-1 ;
	cin >> n;
	vec = v = vector<int>(n);
	for (int i = 0; i < n; i++)
	{
		cin >> v[i];
		vec[i] = v[i];
	}
	sort(all(vec));
	if (check()) return cout << "yes" << endl << 1 << ' ' << 1 << endl, 0;
	for (int i = 0; i < n; i++)
	{
		if (v[i] != vec[i])
		{
			x = i + 1;
			break;
		}
	}
	for (int i = n - 1; i >= 0; i--)
	{
		if (v[i] != vec[i])
		{
			y = i + 1;
			break;
		}
	}
	for (int i = x - 1, j = y - 1; i <= (y - x + 1)/2; i++, j--)
		swap(v[i], v[j]);
	if (check()) cout << "yes" << endl << x << ' ' << y << endl;
	else cout << "no" << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define ull unsigned long long
#define pi 3.141592654
#define F first
#define S second
#define pb push_back
#define endl '\n'
#define all(v)			((v).begin()), ((v).end())
#define rall(v)			((v).rbegin()), ((v).rend())
#define sz(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
void me()
{
	ios::sync_with_stdio(0);
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
}
vector<int> v, vec;
bool check()
{
	for (int i = 0; i < v.size(); i++)
		if (v[i]!=vec[i])
			return false;
	return true;
}
int main()
{
	me();
	int n, x= -1, y=-1 ;
	cin >> n;
	vec = v = vector<int>(n);
	for (int i = 0; i < n; i++)
	{
		cin >> v[i];
		vec[i] = v[i];
	}
	sort(all(vec));
	if (check()) return cout << "yes" << endl << 1 << ' ' << 1 << endl, 0;
	for (int i = 0; i < n; i++)
	{
		if (v[i] != vec[i])
		{
			x = i + 1;
			break;
		}
	}
	for (int i = n - 1; i >= 0; i--)
	{
		if (v[i] != vec[i])
		{
			y = i + 1;
			break;
		}
	}
	for (int i = x - 1, j = y - 1; i < (y - x + 1)/2; i++, j--)
		swap(v[i], v[j]);
	if (check()) cout << "yes" << endl << x << ' ' << y << endl;
	else cout << "no" << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,x=0,y=0,c=0;
    bool check=false,check2=1;
    cin >> n; ll a[n],b[n],z[n];
    for ( ll i=0 ; i<n ; i++ ){ cin >> a[i]; b[i]=a[i]; z[i]=a[i];}
    sort(b,b+n);
    for ( ll i=0 ; i<n ; i++ )
    {
        if ( check==0 && a[i]!=b[i] ){x=i; check=1;}
        else if ( check==1 && a[i]!=b[i] ){y=i; break;}
    }
    for ( ll i=x ; i<=y/2 ; i++ )swap ( z[i],z[y-i]);
    for ( ll i=0 ; i<n ; i++ )
    {
        if ( z[i]!=b[i] ){check2=0; break;}
    }
    (check2)? cout << "yes" << endl << x+1 << ' ' << y+1 << endl : cout << "no" << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,x=0,y=0;
    bool check=0,check2=1;
    cin >> n; ll a[n],b[n],z[n];
    for ( ll i=0 ; i<n ; i++ ){ cin >> a[i]; b[i]=a[i]; z[i]=a[i];}
    sort(b,b+n);
    for ( ll i=0 ; i<n ; i++ ) if ( check==0 && a[i]!=b[i] ){x=i; check=0; break;}
    for ( ll i=n-1 ; i>=0 ; i-- ) if ( check==0 && a[i]!=b[i] ){y=i; break;}
    if ( y!=n-1) for ( ll i=x ; i<=y/2 ; i++ ) swap(z[i],z[y-i+1]);
    else for ( ll i=x ; i<=y/2 ; i++ ) swap(z[i],z[y-i]);
    (check2)? cout << "yes" << endl << x+1 << ' ' << y+1 << endl : cout << "no" << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,x=0,y=0;
    bool check=0,check2=1;
    cin >> n; ll a[n],b[n],z[n];
    for ( ll i=0 ; i<n ; i++ ){ cin >> a[i]; b[i]=a[i]; z[i]=a[i];}
    sort(b,b+n);
    for ( ll i=0 ; i<n ; i++ ) if ( check==0 && a[i]!=b[i] ){x=i; check=0; break;}
    for ( ll i=n-1 ; i>=0 ; i-- ) if ( check==0 && a[i]!=b[i] ){y=i; break;}
    for ( ll i=x ; i<y/2 ; i++ )swap(z[i],z[y-i]);
    for ( ll i=0 ; i<n ; i++ ) if ( z[i]!=b[i] ){check2=0; break;}
    if (check2==1 || z[y]==b[1]) cout << "yes" << endl << x+1 << ' ' << y+1 << endl;
    else cout << "no" << endl;
    return 0;
}


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

int main(){
	int n;
	cin>>n;
	vector<long> v;
	vector<long> a;
	vector<int> ans;
	for(int i=0;i<n;i++){
		long x;
		cin>>x;
		v.push_back(x);
		a.push_back(x);
	}
	sort(a.begin(),a.end());
	for(int i=0;i<n;i++){
		if(v[i]!=a[i]){
			ans.push_back(i+1);
		}
	}
	if(ans.size()==2){
		cout<<"yes"<<endl;
		cout<<ans[0]<<" "<<ans[1]<<endl;
	}
	else if(ans.size()==0){
		cout<<"yes"<<endl;
		cout<<ans[0]<<" "<<ans[0]<<endl;
	}
	else{
		cout<<"no"<<endl;
	}

	return 0;
}


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

int main(){
	int n;
	cin>>n;
	int c=0;
	vector<long> v;
	vector<long> a;
	vector<int> ans;
	for(int i=0;i<n;i++){
		long x;
		cin>>x;
		v.push_back(x);
		a.push_back(x);
	}
	sort(a.begin(),a.end());
	for(int i=0;i<n;i++){
		if(v[i]!=a[i]){
			ans.push_back(i+1);
		}

	}
	//cout<<v[ans[ans.size()-1]-1]<<" ";
	if(ans.size()>0){
		if(v[ans[ans.size()-1]-1]==a[0]){
			cout<<"yes"<<endl;
			cout<<ans[0]<<" "<<ans[1]<<endl;
		}
		else{
			cout<<"no"<<endl;
		}
	}
	else if(ans.size()==0){
		cout<<"yes"<<endl;
		cout<<1<<" "<<1<<endl;
	}
	else{
		cout<<"no"<<endl;
	}

	return 0;
}


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

int main(){
	int n;
	cin>>n;
	int c1=0;
	int c2=0;
	int c=0;
	vector<long> v;
	vector<long> a;
	for(int i=0;i<n;i++){
		long x;
		cin>>x;
		v.push_back(x);
		a.push_back(x);
	}
	sort(a.begin(),a.end());
	for(int i=0;i<n;i++){
		cout<<a[i]<<'f';
		if(v[i]!=a[i]){
			c1=i;
			break;
			//cout<<i+1<<' ';
		}
	}
	for(int j=n-1;j>=0;j--){
		if(v[j]!=a[j]){
			c2=j;
			break;
			//cout<<i+1<<' ';
		}
	}
	for(int k=c1+1;k<=c2;k++){
		if(v[k]>v[k-1]){
			c=-1;
			break;
		}
	}
	cout<<c1<<' '<<c2<<' ';
	if(c==-1){
		cout<<"no"<<endl;
	}
	else{
		cout<<"yes"<<endl;
		cout<<c1+1<<" "<<c2+1<<endl;
	}

	return 0;
}


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

int main(){
	int n;
	cin>>n;
	vector<long> v;
	int a;
	for(int i=0;i<n;i++){
		long x;
		cin>>x;
		if(i==0){
			a=x;
		}
		if((i+1)!=x){
		v.push_back(x);
		}
	}
	if(v.size()==2){
		cout<<"yes"<<endl;
		cout<<v[0]<<" "<<v[1]<<endl;
	}
	else if(v.size()==0){
		cout<<"yes"<<endl;
		cout<<a<<" "<<a<<endl;
	}
	else{
		cout<<"no"<<endl;
	}

	return 0;
}


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

int main(){
	int n;
	cin>>n;
	int c=0;
	vector<long> v;
	vector<long> a;
	vector<int> ans;
	for(int i=0;i<n;i++){
		long x;
		cin>>x;
		v.push_back(x);
		a.push_back(x);
	}
	sort(a.begin(),a.end());
	for(int i=0;i<n;i++){
		if(v[i]!=a[i]){
			ans.push_back(i+1);
		}

	}
	//cout<<v[ans[ans.size()-1]-1]<<" ";
	if(ans.size()>0){
		if(v[ans[ans.size()-1]-1]==a[0]){
			cout<<"yes"<<endl;
			cout<<ans[0]<<" "<<ans[ans.size()-1]<<endl;
		}
		else{
			cout<<"no"<<endl;
		}
	}
	else if(ans.size()==0){
		cout<<"yes"<<endl;
		cout<<1<<" "<<1<<endl;
	}
	else{
		cout<<"no"<<endl;
	}

	return 0;
}


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

int main(){
	int n;
	cin>>n;
	vector<long> v;
	vector<long> a;
	vector<int> ans;
	for(int i=0;i<n;i++){
		long x;
		cin>>x;
		v.push_back(x);
		a.push_back(x);
	}
	sort(a.begin(),a.end());
	for(int i=0;i<n;i++){
		if(v[i]!=a[i]){
			ans.push_back(i+1);
		}
	}
	if(ans.size()==2){
		cout<<"yes"<<endl;
		cout<<ans[0]<<" "<<ans[1]<<endl;
	}
	else if(ans.size()==0){
		cout<<"yes"<<endl;
		cout<<a[0]<<" "<<a[0]<<endl;
	}
	else{
		cout<<"no"<<endl;
	}

	return 0;
}


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

int main(){
	int n;
	cin>>n;
	vector<long> v;
	int a;
	for(int i=0;i<n;i++){
		long x;
		cin>>x;
		if(i==0){
			a=x;
		}
		if((i+1)!=x){
		v.push_back(x);
		}
	}
	if(v.size()==2){
		cout<<"yes"<<endl;
		cout<<v[1]<<" "<<v[0]<<endl;
	}
	else if(v.size()==0){
		cout<<"yes"<<endl;
		cout<<a<<" "<<a<<endl;
	}
	else{
		cout<<"no"<<endl;
	}

	return 0;
}


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

int main(){
	int n;
	cin>>n;
	int c=0;
	vector<long> v;
	vector<long> a;
	vector<int> ans;
	for(int i=0;i<n;i++){
		long x;
		cin>>x;
		v.push_back(x);
		a.push_back(x);
	}
	sort(a.begin(),a.end());
	for(int i=0;i<n;i++){
		if(v[i]!=a[i]){
			ans.push_back(i+1);
		}

	}
	//cout<<v[ans[ans.size()-1]-1]<<" "<<ans[0];
	if(ans.size()>0){
		if(v[ans[ans.size()-1]-1]==a[ans[0]-1]){
			cout<<"yes"<<endl;
			cout<<ans[0]<<" "<<ans[ans.size()-1]<<endl;
		}
		else{
			cout<<"no"<<endl;
		}
	}
	else if(ans.size()==0){
		cout<<"yes"<<endl;
		cout<<1<<" "<<1<<endl;
	}
	else{
		cout<<"no"<<endl;
	}

	return 0;
}


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

int main(){
	int n;
	cin>>n;
	int c1=0;
	int c2=0;
	int c=0;
	vector<long> v;
	vector<long> a;
	for(int i=0;i<n;i++){
		long x;
		cin>>x;
		v.push_back(x);
		a.push_back(x);
	}
	sort(a.begin(),a.end());
	for(int i=0;i<n;i++){
		//cout<<a[i]<<'f';
		if(v[i]!=a[i]){
			c1=i;
			break;
			//cout<<i+1<<' ';
		}
	}
	for(int j=n-1;j>=0;j--){
		if(v[j]!=a[j]){
			c2=j;
			break;
			//cout<<i+1<<' ';
		}
	}
	for(int k=c1+1;k<=c2;k++){
		if(v[k]>v[k-1]){
			c=-1;
			break;
		}
	}
	//cout<<c1<<' '<<c2<<' ';
	if(c==-1){
		cout<<"no"<<endl;
	}
	else{
		cout<<"yes"<<endl;
		cout<<c1+1<<" "<<c2+1<<endl;
	}

	return 0;
}


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

int main(){
	int n;
	cin>>n;
	int c=0;
	vector<long> v;
	vector<long> a;
	vector<int> ans;
	for(int i=0;i<n;i++){
		long x;
		cin>>x;
		v.push_back(x);
		a.push_back(x);
	}
	sort(a.begin(),a.end());
	for(int i=0;i<n;i++){
		if(v[i]!=a[i]){
			ans.push_back(i+1);
			//cout<<i+1<<' ';
			if(v[i-1]>v[i]){
				c++;
			}
		}
	}
	if(ans.size()!=(c-1)){
		c= -1;
	}
	if(ans.size()>0){
		if(v[ans[ans.size()-1]-1]==a[ans[0]-1]&& c!=-1){
			cout<<"yes"<<endl;
			cout<<ans[0]<<" "<<ans[ans.size()-1]<<endl;
		}
		else{
			cout<<"no"<<endl;
		}
	}
	else if(ans.size()==0){
		cout<<"yes"<<endl;
		cout<<1<<" "<<1<<endl;
	}
	else{
		cout<<"no"<<endl;
	}

	return 0;
}


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

int main(){
	int n;
	cin>>n;
	vector<long> v;
	vector<long> a;
	vector<int> ans;
	for(int i=0;i<n;i++){
		long x;
		cin>>x;
		v.push_back(x);
		a.push_back(x);
	}
	sort(a.begin(),a.end());
	for(int i=0;i<n;i++){
		if(v[i]!=a[i]){
			ans.push_back(i+1);
		}
	}
	if(ans.size()==2){
		cout<<"yes"<<endl;
		cout<<v[1]<<" "<<v[0]<<endl;
	}
	else if(ans.size()==0){
		cout<<"yes"<<endl;
		cout<<v[0]<<" "<<v[0]<<endl;
	}
	else{
		cout<<"no"<<endl;
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    long long arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    int f=0,flag=0;long s=0,e=0;
    for(long long i=0;i<n-1;i++)
    {
        if(arr[i]<arr[i+1])
        flag=0;
        else if(flag && arr[i]>arr[i+1])
        e =i;
        else if(arr[i]>arr[i+1])
        {
            flag=1;
            s=i;e=i;
        }

    }
    long long temp=arr[s];
    arr[s]==arr[e];
    arr[e]=temp;
    e++;
    int f1=1,f2=1;
    for(long long i=0;i<s;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f1=0;break;
        }
    }
       for(long long i=e;i<n-1;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f2=0;break;
        }
    }
      if(f1 && f2)
      { cout<<"yes"<<endl; cout<<s+1<<" "<<e+2;}

    else
    cout<<"no";
return 0;}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    long long arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    int f=0,flag=0;long s=0,e=0;
    for(long long i=0;i<n-1;i++)
    {
        if(arr[i]<arr[i+1])
        flag=0;
        else if(flag && arr[i]>arr[i+1])
        e =i;
        else if(arr[i]>arr[i+1])
        {
            flag=1;
            s=i;e=i;
        }

    }
    long long temp=arr[s];
    arr[s]==arr[e];
    arr[e]=temp;e++;
    int f1=1,f2=1;
    for(long long i=0;i<s;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f1=0;break;
        }
    }
       for(long long i=e;i<n-1;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f2=0;break;
        }
    }
      if(f1 && f2)
      { cout<<"yes"<<endl; cout<<s+1<<" "<<e+1;}

    else
    cout<<"no";
return 0;}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    long long arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    int f=0,flag=0;long s=0,e=0;
    for(long long i=0;i<n;i++)
    {
        if(arr[i]<arr[i+1])
        flag=1;
        else if(flag && arr[i]>arr[i+1])
        e =i;
        else if(arr[i]>arr[i+1])
        {
            flag=1;
            s=i;e=i;
        }

    }
    int f1=1,f2=1;
    for(long long i=0;i<s;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f1=0;break;
        }
    }
       for(long long i=e;i<n-1;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f2=0;break;
        }
    }
      if(f1 && f2)
      { cout<<"yes"<<endl; cout<<s<<" "<<e;}

    else
    cout<<"no";
return 0;}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    long long arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    int f=0,flag=0;long s=0,e=0;
    for(long long i=0;i<n-1;i++)
    {
        if(arr[i]<arr[i+1])
        flag=0;
        else if(flag && arr[i]>arr[i+1])
        e =i;
        else if(arr[i]>arr[i+1])
        {
            flag=1;
            s=i;e=i;
        }

    }
    long long temp=arr[s];
    arr[s]==arr[e];
    arr[e]=temp;
    int f1=1,f2=1;
    for(long long i=0;i<s;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f1=0;break;
        }
    }
       for(long long i=e;i<n-1;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f2=0;break;
        }
    }
      if(f1 && f2)
      { cout<<"yes"<<endl; cout<<s<<" "<<e;}

    else
    cout<<"no";
return 0;}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    long long arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    int f=0,flag=0;long s=0,e=0;
    for(long long i=0;i<n-1;i++)
    {
        if(arr[i]<arr[i+1])
        flag=0;
        else if(flag && arr[i]>arr[i+1])
        e =i;
        else if(arr[i]>arr[i+1])
        {
            flag=1;
            s=i;e=i;
        }

    }
    if(e==n-2 && arr[e]>arr[n-1])
    e++;
    long long temp=arr[s];
    arr[s]==arr[e];
    arr[e]=temp;
    int f1=1,f2=1;
    for(long long i=0;i<s;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f1=0;break;
        }
    }
       for(long long i=e;i<n-1;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f2=0;break;
        }
    }
      if(f1 && f2)
      { cout<<"yes"<<endl; cout<<s<<" "<<e;}

    else
    cout<<"no";
return 0;}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    long long arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    int f=0,flag=0;long s=0,e=0;
    for(long long i=0;i<n-1;i++)
    {
        if(arr[i]<arr[i+1])
        flag=0;
        else if(flag && arr[i]>arr[i+1])
        e =i;
        else if(arr[i]>arr[i+1])
        {
            flag=1;
            s=i;e=i;
        }

    }
    long long temp=arr[s];
    arr[s]==arr[e];
    arr[e]=temp;
    int f1=1,f2=1;
    for(long long i=0;i<s;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f1=0;break;
        }
    }
       for(long long i=e;i<n-1;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f2=0;break;
        }
    }
      if(f1 && f2)
      { cout<<"yes"<<endl; cout<<s+1<<" "<<e+2;}

    else
    cout<<"no";
return 0;}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    long long arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    int f=0,flag=0;long s=0,e=0;
    for(long long i=0;i<n-1;i++)
    {
        if(arr[i]<arr[i+1])
        flag=0;
        else if(flag && arr[i]>arr[i+1])
        e =i;
        else if(arr[i]>arr[i+1])
        {
            flag=1;
            s=i;e=i;
        }

    }
    int f1=1,f2=1;
    for(long long i=0;i<s;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f1=0;break;
        }
    }
       for(long long i=e;i<n-1;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f2=0;break;
        }
    }
      if(f1 && f2)
      { cout<<"yes"<<endl; cout<<s<<" "<<e;}

    else
    cout<<"no";
return 0;}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    long long arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    int f=0,flag=0;long s=0,e=0;
    for(long long i=0;i<n-1;i++)
    {
        if(arr[i]<arr[i+1])
        flag=1;
        else if(flag && arr[i]>arr[i+1])
        e =i;
        else if(arr[i]>arr[i+1])
        {
            flag=1;
            s=i;e=i;
        }

    }
    int f1=1,f2=1;
    for(long long i=0;i<s;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f1=0;break;
        }
    }
       for(long long i=e;i<n-1;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f2=0;break;
        }
    }
      if(f1 && f2)
      { cout<<"yes"<<endl; cout<<s<<" "<<e;}

    else
    cout<<"no";
return 0;}


#include<bits/stdc++.h>
using namespace std;
int main()
{ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    long m;
   cin>>m;
   long arr[m],brr[m];
   for(int i=0;i<m;i++)
   {
       cin>>arr[i];
       brr[i]=arr[i];
   }
   long s,e;
   sort(brr,brr+m);int f=1;
   for(int i=0;i<m;i++)
   {
       if(arr[i]!=brr[i]){
           s=i;e=i;i++;f++;
           while(i!=m )
           {if(arr[i]==brr[i] && arr[i-1]>=arr[i])
           e=i++;
           else if(arr[i]!=brr[i])
           e=i++;}
       }
   }
   if(f==1)
   {
       cout<<"yes"<<endl;
       cout<<"1 1"<<endl;
       return 0;
   }
   if(f>2)
   {
       cout<<"no"<<endl;
   }
   for(long i=e,j=0;i>=s;i--,j++)
   {
       if(arr[i]!=brr[s+j])
       {
           cout<<"no"<<endl;
           return 0;
       }
   }cout<<"yes"<<endl;
   cout<<s+1<<" "<<e+1;
return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    long long arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    int f=0,flag=0;long s=0,e=0;
    for(long long i=0;i<n-1;i++)
    {
        if(arr[i]<arr[i+1])
        flag=0;
        else if(flag && arr[i]>arr[i+1])
        e =i;
        else if(arr[i]>arr[i+1])
        {
            flag=1;
            s=i;e=i;
        }

    }
    if(e==n-2 && arr[e]>arr[n-1])
    e++;
    long long temp=arr[s];
    arr[s]==arr[e];
    arr[e]=temp;
    int f1=1,f2=1;
    for(long long i=0;i<s;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f1=0;break;
        }
    }
       for(long long i=e;i<n-1;i++)
    {
        if(arr[i]>arr[i+1])
        {
            f2=0;break;
        }
    }
      if(f1 && f2)
      { cout<<"yes"<<endl; cout<<s+1<<" "<<e+1;}

    else
    cout<<"no";
return 0;}


#include<bits/stdc++.h>
using namespace std;
int main()
{ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    long m;
   cin>>m;
   long arr[m],brr[m];
   for(int i=0;i<m;i++)
   {
       cin>>arr[i];
       brr[i]=arr[i];
   }
   long s,e;
   sort(brr,brr+m);int f=1;
   for(int i=0;i<m;i++)
   {
       if(arr[i]!=brr[i] && f==1)
           {s=i;e=i;f++;}
            if(arr[i]!=brr[i] && f==2)
           e=i;

   }
   if(f==1)
   {
       cout<<"yes"<<endl;
       cout<<"1 1"<<endl;
       return 0;
   }
   if(f>2)
   {
       cout<<"no"<<endl;
   }
   for(int i=0;i<s;i++)
   {
       if(arr[i]!=brr[i])
       {
        cout<<"no"<<endl;
           return 0;
       }}
        for(int i=e+1;i<m;i++)
   {
       if(arr[i]!=brr[i])
       {
        cout<<"no"<<endl;
           return 0;
       }}
   for(long i=e,j=0;i>=s;i--,j++)
   {
       if(arr[i]!=brr[s+j])
       {
           cout<<"no"<<endl;
           return 0;
       }
   }cout<<"yes"<<endl;
   cout<<s+1<<" "<<e+1;
return 0;

}


#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>

using namespace std;

int main()
{ long int n,i,j,pos1=0,pos2=0,temp;
   cin>>n;
   int a[n],flag=0;
   for(i=0;i<n;i++)
   {
       cin>>a[i];
   }
   for(i=0;i<n;i++)
   {
       if(a[i]>a[i+1])
       { temp=a[i];
         pos1=i;
         pos2=i;
           for(j=i;j<n;j++)
           {
               if(a[j]<a[j+1])
               { pos2=j;

                       if(a[j+1]>a[j])
                       {
                           pos2=j;
                           break;
                           if(a[j+1]<temp)
                       {
                         flag=1; break;
                       }
                       }

                 }
                 i=j;
           }
           if(pos2==pos1)
            pos2=n-1;

           if(flag==1)
            break;
       }
   }

   if(flag==0)
   {
       cout<<"yes"<<endl;
       cout<<pos1+1<<" "<<pos2+1;
   }
   else
    cout<<"no";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
	unsigned long long int n;
	cin>>n;
	unsigned long long int a[n], pos1=0,pos2=0,cnt=0,flag=0,j,i;
	for(i=0;i<n;i++)
	{
	    cin>>a[i];
	}
	 for(i=0;i<n;i++)
	 {    if(i!=(n-1))
	     if(a[i]>a[i+1])
	     {   pos1=i;
	     pos2=i;
	     cnt++;
	         for(j=i+1;j<n;j++)
	         {  i++;
	            pos2=j;
	             if(j!=(n-1))
	             if(a[j]<a[j+1])
	             {
	                 pos2=j;
	                 if(a[j+1]<a[pos1])
	                 {
	                     flag=1;
	                 }

	                 break;
	             }
	         }
	     }
	 }
	 if(pos2==pos1 && cnt==1)
	 pos2=n-1;
	  if(a[pos2]<a[pos1-1] && cnt==1 && pos1!=0)
	                {
	                    cout<<"no";
	                    exit(0);
	                 }

	 if(cnt==1 && flag==0)
	 { cout<<"yes"<<endl;
	 cout<<pos1+1<<" "<<pos2+1;}
	 else if(flag==0 and cnt==0)
	 {
	     cout<<"yes"<<endl;
	     cout<<1<<" "<<1;
	 }
	 else
	 cout<<"no";
	return 0;
}


#include<stdio.h>

int length(char str[]){
    int i = 0;
    for(; str[i]; i++); // for(int i = 0; str[i] != '\0'; i++){}
    return i;
}

int main(){
	char a[100],s;
//	printf("\nNhap chuoi: ");
	gets(a);
	s = length(a);
	if(s >= 10){
		printf("%c%d%c",a[0],s-2,a[s-1]);
	}else{
		printf("%s", a);
	}
}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>
int length(char str[]){
    int i = 0;
    for(; str[i]; i++); // for(int i = 0; str[i] != '\0'; i++){}
    return i;
}
// asd123asd
int main(){
	char a[100],s,year;
	gets(a);
	s = length(a);
//	printf("\nNhap chuoi: ");
	bool isnumber = true;
	int i=1;
	while(i<=s){
		if (isdigit(a[i]))
  		{
			  isnumber = false;
		}
		i++;
	}
//	printf("%d %d",i,s);
	if(isnumber == false) return 0;

	if(s >= 10){
		printf("%c%d%c",a[0],s-2,a[s-1]);
	}else{
		printf("%s", a);
	}
}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>

int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	int n;
	scanf("%d",&n);
	while(n--){
		int isnumber = 1;
		scanf("%s",&a);
		s = length(a);
		int i=0;
		while(i<=s){
			if (isdigit(a[i]))
	  		{
				  isnumber = 0;

			}
			i++;
		}
		if(isnumber == 1){
			if(s >= 10){
				printf("%c%d%c",a[0],s-2,a[s-1]);
			}else{
				printf("%s", a);
			}
			printf("\n");
		}

	}

}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>

int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	int n;
	scanf("%d",&n);
	while(n--){
		int isnumber = 1;
		scanf("%s",&a);
		s = length(a);
		int i=0;
		while(i<=s){
			if (isdigit(a[i]))
	  		{
				  isnumber = 0;

			}
			i++;
		}
		if(isnumber == 1){
			if(s >= 8){
				printf("%c%d%c",a[0],s-2,a[s-1]);
			}else{
				printf("%s", a);
			}
			printf("\n");
		}

	}

}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>
int isnumber = 1;
int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	gets(a);
	s = length(a);
	int i=0;
	while(i<=s){
		if (isdigit(a[i]))
  		{
			  isnumber = 0;
		}
		i++;
	}
	if(isnumber == 0) return 0;

	if(s >= 10){
		printf("%c%d%c",a[0],s-2,a[s-1]);
	}else{
		printf("%s", a);
	}
}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>
bool isnumber = true;
int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	gets(a);
	s = length(a);
	int i=0;
	while(i<=s){
		if (isdigit(a[i]))
  		{
			  isnumber = false;
		}
		i++;
	}
	if(isnumber == false) return 0;

	if(s >= 10){
		printf("%c%d%c",a[0],s-2,a[s-1]);
	}else{
		printf("%s", a);
	}
}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>

int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	int n;
	scanf("%d",&n);
	while(n--){
		int isnumber = 1;
		printf("\n");
		gets(a);
		s = length(a);
		int i=0;
		while(i<=s){
			if (isdigit(a[i]))
	  		{
				  isnumber = 0;
			}
			i++;
		}
		if(isnumber == 1){
			if(s >= 10){
				printf("%c%d%c",a[0],s-2,a[s-1]);
			}else{
				printf("%s", a);
			}
		}
	}

}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>
int isnumber = 1;
int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	gets(a);
	s = length(a);
	int i=0;
	while(i<=s){
		if (isdigit(a[i]))
  		{
			  isnumber = 0;
		}
		i++;
	}
	if(isnumber == 1){
		if(s >= 10){
		printf("%c%d%c",a[0],s-2,a[s-1]);
		}else{
			printf("%s", a);
		}
	}

}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>

int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	int n;
	scanf("%d",&n);
	while(n--){
		int isnumber = 1;
		scanf("%s",&a);
		s = length(a);
		int i=0;
		while(i<=s){
			if (isdigit(a[i]))
	  		{
				  isnumber = 0;

			}
			i++;
		}
		if(isnumber == 1){
			if(s >= 12){
				printf("%c%d%c",a[0],s-2,a[s-1]);
			}else{
				printf("%s", a);
			}
			printf("\n");
		}

	}

}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>

int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	int n;
	scanf("%d",&n);
	while(n--){
		int isnumber = 1;

		gets(a);
		s = length(a);
		int i=0;
		while(i<=s){
			if (isdigit(a[i]))
	  		{
				  isnumber = 0;
			}
			i++;
		}
		if(isnumber == 1){
			if(s >= 10){
				printf("%c%d%c",a[0],s-2,a[s-1]);
			}else{
				printf("%s", a);
			}
			printf("\n");
		}

	}

}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>

int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	gets(a);
	s = length(a);
	int i=0;
	while(i<=s){
		if (isdigit(a[i]))
  		{
  			printf("");
			return 0;
		}
		i++;
	}
	if(s >= 10){
		printf("%c%d%c",a[0],s-2,a[s-1]);
	}else{
		printf("%s", a);
	}
}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>
int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	gets(a);
	s = length(a);
	bool isnumber = true;
	int i=0;
	while(i<=s){
		if (isdigit(a[i]))
  		{
			  isnumber = false;
		}
		i++;
	}
	if(isnumber == false) return 0;

	if(s >= 10){
		printf("%c%d%c",a[0],s-2,a[s-1]);
	}else{
		printf("%s", a);
	}
}


#include<stdio.h>

int main(){
	int w;
	scanf("%d",&w);
	if(w % 2 == 0 && w > 0 && w <= 100 && w != 2){
		printf("YES");
	}else{
		printf("NO");
	}
}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>

int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	int n;
	scanf("%d",&n);
	while(n--){
		int isnumber = 1;
		scanf("%s",&a);
		s = length(a);
		int i=0;
		while(i<=s){
			if (isdigit(a[i]))
	  		{
				  isnumber = 0;

			}
			i++;
		}
		if(isnumber == 1){
			if(s >= 11){
				printf("%c%d%c",a[0],s-2,a[s-1]);
			}else{
				printf("%s", a);
			}
			printf("\n");
		}

	}

}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>

int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	int n;
	scanf("%d",&n);
	while(n--){
		int isnumber = 1;
		gets(a);
		s = length(a);
		int i=0;
		while(i<=s){
			if (isdigit(a[i]))
	  		{
				  isnumber = 0;
			}
			i++;
		}
		if(isnumber == 1){
			if(s >= 10){
				printf("%c%d%c",a[0],s-2,a[s-1]);
			}else{
				printf("%s", a);
			}
		}
	}

}


#include<stdio.h>
#include <stdlib.h>
#include <ctype.h>

int length(char str[]){
    int i = 0;
    for(; str[i]; i++);
    return i;
}
int main(){
	char a[100],s,year;
	int n;
	scanf("%d",&n);
	while(n--){
		int isnumber = 1;

		gets(a);
		s = length(a);
		int i=0;
		while(i<=s){
			if (isdigit(a[i]))
	  		{
				  isnumber = 0;
				  break;
			}
			i++;
		}
		if(isnumber == 1){
			if(s >= 10){
				printf("%c%d%c",a[0],s-2,a[s-1]);
			}else{
				printf("%s", a);
			}
			printf("\n");
		}

	}

}


#include<stdio.h>
#include <string.h>
int main()
{
    char s[100];
    int n,m,x;

    scanf("%d",&n);

    for(n=n;n>=n;n--)
    {
    gets(s);

    x=strlen(s);

    m=x-2;
    if(x<10)
    {
      printf("%s",s);
    }
    else
    {
    printf("%s%d%s",s[0],m,s[n-1]);
    }

    }
    return 0;
}


#include<stdio.h>
#include<ctype.h>
int main()
{
     int n,m;
    char s[6000];
    scanf("%d",&n);

    while(n--)
    {
    scanf("%s",s);
   int m=strlen(s);

    if(m<10)
    {
      printf("%s\n",s);
    }
    else
    {
    printf("%c%d%c\n",s[0],m-2,s[m-1]);
    }

    }
    return 0;
}


#include<stdio.h>
#include<ctype.h>
int main()
{
     int n,m;
    char s[6000];
    scanf("%d",&n);

    while(n--)
    {
    scanf("%s",s);
    m=strlen(s);

    if(m<10)
    {
      printf("%s",s);
    }
    else
    {
    printf("%c%d%c",s[0],m-2,s[m-1]);
    }

    }
    return 0;
}


#include<stdio.h>
#include <string.h>
int main()
{
     int n,m;
    char s[6000];
    scanf("%d",&n);

    while(n--)
    {
    scanf("%s",s);
     m=strlen(s);

    if(m<10)
    {
      printf("%s",s);
    }
    else
    {
    printf("%c%d%c",s[0],m-2,s[m-1]);
    }

    }
    return 0;
}


#include <string.h>
int main()
{
     int n,m,x;
    char s[100];
    char a,b;

    scanf("%d",&n);

    for(n=n;n>=n;n--)
    {
    gets(s);

    x=strlen(s);

    m=x-2;
    a=s[0];
    b=s[n-2];
    if(x<10)
    {
      printf(s);
    }
    else
    {
    printf("%c%d%c",a,m,b);
    }

    }
    return 0;
}


#include<stdio.h>
#include <string.h>
int main()
{
     int n,m,x;
    char s[100];
    scanf("%d",&n);

    for(n=n;n>0;n--)
    {
    scanf("%s",s);

    x=strlen(s);

    m=x-2;
    if(x<10)
    {
      printf(s);
    }
    else
    {
    printf("%c%d%c",s[0],m,s[x-1]);
    }

    }
    return 0;
}


#include<stdio.h>
#include<ctype.h>
int main(){
    int n,i,m;
char x[6000];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%s",&x);
int l=strlen(x);

if(l>10){

    printf("%c",x[0]);
    printf("%d",l-2);
    printf("%c\n",x[l-1]);

}
else printf("%s\n",x);}
return 0;
}


#include<stdio.h>
#include <string.h>
#include<ctype.h>
int main()
{
     int n,m;
    char s[6000];
    scanf("%d",&n);

    while(n--)
    {
    scanf("%s",s);
     m=strlen(s);

    if(m<10)
    {
      printf("%s",s);
    }
    else
    {
    printf("%c%d%c",s[0],m-2,s[m-1]);
    }

    }
    return 0;
}


#include<stdio.h>
#include <string.h>
int main()
{
     int n,m;
    char s[6000];
    scanf("%d",&n);

    while(n--)
    {
    scanf("%s",s);
   int m=strlen(s);

    if(m<10)
    {
      printf("%s",s);
    }
    else
    {
    printf("%c%d%c",s[0],m-2,s[m-1]);
    }

    }
    return 0;
}


#include<stdio.h>
#include<ctype.h>
int main()
{
     int n,m;
    char s[6000];
    scanf("%d",&n);

    while(n--)
    {
    scanf("%s",s);
   int m=strlen(s);

    if(m<=10)
    {
      printf("%s\n",s);
    }
    else
    {
    printf("%c%d%c\n",s[0],m-2,s[m-1]);
    }

    }
    return 0;
}


#include<stdio.h>
#include <string.h>
int main()
{
     int n,m,x,i;
    char s[100];
    scanf("%d",&n);

    for(n=n;n>0;n--)
    {
    scanf("%s",s);
     for(i = 0; s[i] != '\0'; ++i);
    {
        x=i;
    }

    m=x-2;
    if(x<10)
    {
      printf(s);
    }
    else
    {
    printf("%c%d%c",s[0],m,s[x-1]);
    }

    }
    return 0;
}


#include<stdio.h>
#include <string.h>
#include<ctype.h>
int main()
{
     int n,m;
    char s[6000];
    scanf("%d",&n);

    while(n--)#include<ctype.h>
    {
    scanf("%s",s);
     m=strlen(s);

    if(m<10)
    {
      printf("%s",s);
    }
    else
    {
    printf("%c%d%c",s[0],m-2,s[m-1]);
    }

    }
    return 0;
}


#include<stdio.h>
#include <string.h>
int main()
{
     int n,m;
    char s[6000];
    scanf("%d",&n);

    for(n=n;n>0;n--)
    {
    scanf("%s",&s);
     m=strlen(s);

    if(m<10)
    {
      printf(s);
    }
    else
    {
    printf("%c%d%c",s[0],m-2,s[m-1]);
    }

    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{
    long long int m,i,j,n;
    char x[99999];
    while(~scanf("%lld",&n))
    {
        getchar();
        for(i=1; i<=n; i++)
        {
            gets(x);
            m=strlen(x);
            if(m<=10)
                printf("%s\n",x);
            else
            {
                printf("%c%lld%c\n",x[0],m-2,x[m-1]);
            }
        }
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{   int p,n,i;
    char s[100];
    while(~scanf("%d",&n))
    {for(i=0;i<n;i++)
     {scanf("%s",s);
      p=strlen(s);
      if(p>10)
      {printf("%c%d%c\n",s[0],p-2,s[p-1]);
      }
      if(p<=10)
      {printf("%s\n",s);
      }
     }
    }
    return 0;
}


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

int main()
{
    char s[1000];
    int a,c;
    while(~scanf("%d",&a))
    {
        while(a--)
        {
            scanf("%s",s);
            c=strlen(s);
            if(c>=12)
            {
                printf("%c%d%c\n",s[0],c-2,s[c-1]);
            }
            else
            {
                printf("%s\n",s);
            }
        }
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{   int n,k;
    char s[1000];
    scanf("%d",&n);
    getchar();
    while(n>0)
        {gets(s);
    k=strlen(s);
    if(k<10)
        {printf("%s\n",s);}
    else
    {printf("%c%d%c\n",s[0],k-2,s[k-1]);}

    n--;}
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{  int n,i,j,b,t;
 char a[100];
 while(~scanf("%d",&n))
 {
     for(i=1;i<=n;i++)
     {
         scanf("%s",&a);
         t=strlen(a);
         b=t-2;
         if(t<10)
            printf("%s\n",a);
         else
        printf("%c%d%c\n",a[0],b,a[t-1]);
     }
 }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{   int n,k;
    char s[1000];
    scanf("%d",&n);
    getchar();
    while(n>0)
        {gets(s);
    k=strlen(s);
    if(k<10)
        printf("%s\n",s);
    else
    printf("%c%d%c\n",s[0],k-2,s[k-1]);
    n--;}
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{   int n,k;
    char s[1000];
    scanf("%d",&n);
    getchar();
    while(n>0)
        {gets(s);
    k=strlen(s);
    if(k<=10)
        {printf("%s\n",s);}
    else
    {printf("%c%d%c\n",s[0],k-2,s[k-1]);}

    n--;}
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int n,m,a;
    char s[100000];
    while(~scanf("%d",&n))
    {

        while(n--)
        {
            scanf("%s",s);
            m=strlen(s);
            a=m-2;
            if(m>10)
                printf("%c%d%c\n",s[0],a,s[m-1]);
            else
                    printf("%s\n",s);

        }
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int n,i,m;
    char s[9999];
    while(~scanf("%d",&n))
    {
        getchar();
        for(i=0; i<n; i++)
        {
            gets(s);
            m=strlen(s);
            if(m<10)
                printf("%s\n",s);
            else
                printf("%c%d%c\n",s[0], m-2,s[m-1]);
        }
    }
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int n,a,b,c,m;
    char s[200];
    while(~scanf("%d",&n))
    {
        getchar();
        for(a=0;a<n;a++)
        {
            gets(s);
            m=strlen(s);
            if(m<=10)
            {
                puts(s);
            }
            else
            {
                printf("%c%d%c\n",s[0],m-2,s[m-1]);
            }
        }
    }
    return 0;
}


#include <string.h>
int main()
{
    char a[1000];
    int n;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%s",a);
        n=strlen(a);
        if(n<=10)
            printf("%s",a);
        else if(n>10)
        printf("%c%d%c",a[0],n-2,a[n-1]);
        printf("\n");
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main()
    {char a[101];
   long long int n,w,i,k=0;
    scanf("%lld",&n);
     getchar();
    while (n--)
    {

      scanf("%s",a);
      w=strlen(a);
      if(w<=10)
        {for(i=0;i<w;i++)
        printf("%c",a[i]);
        printf("\n");}
      else
      {for(i=1;i<w-1;i++)
        {if(a[i]>='a'&&a[i]<='z')
        k++;}
      printf("%c%lld%c\n",a[0],k,a[i]);
      k=0;}
} return 0;}


#include<stdio.h>

int main(){
    int n,i,m;
char x[6000];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%s",&x);
int l=strlen(x);

if(l>10){

    printf("%c",x[0]);
    printf("%d",l-2);
    printf("%c\n",x[l-1]);

}
else printf("%s\n",x);}
return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
    char a[150];
    int i,n,e,f;
    scanf("%d",&n);

    for(i=1;i<=n;i++){
    scanf("%s",&a);
    e=strlen(a);
    if(e>10){

        printf("%c%d%c\n",&a[0],e-2,&a[e-1]);
    }

    else if(e<=10){

        printf("%s",a);
    }
    }

    return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
    char a[101];
    int i,n,e,f;
    scanf("%d",&n);

    for(i=1;i<=n;i++){
    scanf("%s",&a);
    e=strlen(a);
    if(e>10){

        printf("%c%d%c\n",&a[0],e-2,&a[e-1]);
    }

    else if(e<=10){

        printf("%s",a);
    }
    }

    return 0;
}


#include<stdio.h>
int main()
{
    char a[50];
    int i,n;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
    scanf("%s",a);

    if(a[0]=='l'){
        printf("l10n\n");
    }

    else if(a[0]=='w'){

        printf("word\n");

    }

     else if(a[0]=='i'){

        printf("i18n\n");

    }

     else if(a[0]=='p'){

        printf("p43s\n");

    }

    }

    return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
    char a[150];
    int i,n,e,f;
    scanf("%d",&n);

    for(i=1;i<=n;i++){
    scanf("%s",&a);
    e=strlen(a);
    if(e<10) printf("%s",a);
        else  printf("%c%d%c\n",a[0],e-2,a[e-1]);

    }

    return 0;
}


#include<stdio.h>

int main()
{
    char a[150];
    int i,n,e,f;
    scanf("%d",&n);
    if(n>=1 && n<=100){

    for(i=1;i<=n;i++){
    scanf("%s",&a);
    e=strlen(a);
    if(e<10) printf("%s",a);
        else  printf("%c%d%c\n",a[0],e-2,a[e-1]);

    }

    }

    return 0;
}


#include<stdio.h>

int main()
{
    char a[150];
    int i,n,e,f;
    scanf("%d",&n);

    for(i=1;i<=n;i++){
    scanf("%s",&a);
    e=strlen(a);
    if(e<10) printf("%s",a);
        else  printf("%c%d%c\n",a[0],e-2,a[e-1]);

    }

    return 0;
}


#include<stdio.h>
#include<ctype.h>
int main(){
    int n,i,m;
char x[6000];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%s",&x);
int l=strlen(x);

if(l>10){

    printf("%c",x[0]);
    printf("%d",l-2);
    printf("%c\n",x[l-1]);

}
else printf("%s\n",x);}
return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
    long int n,i,j,l;
    printf("Enter the number of words: ");
    scanf("%ld",&n);
    printf("Enter %ld words: ",n);
    char c[n][100];
    for(i=0;i<n;i++)
    {
        scanf("%s",&c[i]);
    }
    for(j=0;j<i;j++)
    {
        l=strlen(c[j]);
        if(l<=10)
            printf("%s\n",c[j]);
        else
            printf("%c%ld%c",c[j][0],l-2,c[j][l-1]);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
    int n,i,j,l;

    scanf("%d",&n);

    char c[n][100];
    for(i=0;i<n;i++)
    {
        scanf("%s",&c[i]);
    }
    for(j=0;j<n;j++)
    {
        l=strlen(c[j]);
        if(l<=10)
            printf("%s\n",c[j]);
        else
            printf("%c%d%c\n",c[j][0],l-2,c[j][l-1]);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
    int n,i,j,l;

    scanf("%d",&n);

    char c[n][101];
    for(i=0;i<n;i++)
    {
        scanf("%s",&c[i]);
    }
    for(j=0;j<n;j++)
    {
        l=strlen(c[j]);
        if(l<=10)
            printf("%s\n",c[j]);
        else
            printf("%c%d%c\n",c[j][0],l-2,c[j][l-1]);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    int n,i,j,l;
    scanf("%d",&n);
    char c[n][100];
    for(i=0;i<n;i++)
    {
        scanf("%s",&c[i]);
    }
    for(j=0;j<n;j++)
    {
        l=strlen(c[i]);
        if(l>10)
            printf("%c%d%c\n",c[j][0],l-2,c[j][l-1]);
        else
            printf("%s\n",c[j]);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
    int n,i,j,l;
    printf("Enter the number of words: ");
    scanf("%d",&n);
    printf("Enter %d words: ",n);
    char c[n][100];
    for(i=0;i<n;i++)
    {
        scanf("%s",&c[i]);
    }
    for(j=0;j<n;j++)
    {
        l=strlen(c[j]);
        if(l<=10)
            printf("%s\n",c[j]);
        else
            printf("%c%d%c",c[j][0],l-2,c[j][l-1]);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    int n,i,j,l;
    scanf("%d",&n);
    char c[n][100];
    for(i=0;i<n;i++)
    {
        scanf("%s",&c[i]);
    }
    for(j=0;j<n;j++)
    {
        l=strlen(c[i]);
        if(l<=10)
            printf("%s\n",c[j]);
        else
            printf("%c%d%c\n",c[j][0],l-2,c[j][l-1]);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    long int n,i,j,l;
    printf("Enter the number of words: ");
    scanf("%ld",&n);
    printf("Enter %ld words: ",n);
    char c[n][101];
    for(i=0;i<n;i++)
    {
        scanf("%s",&c[i]);
    }
    for(j=0;j<i;j++)
    {
        l=strlen(c[j]);
        if(l<=10)
            printf("%s\n",c[j]);
        else
            printf("%c%ld%c",c[j][0],l-2,c[j][l-1]);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    int n,i,j,l;
    printf("Enter the number of words: ");
    scanf("%d",&n);
    printf("Enter %d words: ",n);
    char c[n][101];
    for(i=0;i<n;i++)
    {
        scanf("%s",&c[i]);
    }
    for(j=0;j<n;j++)
    {
        l=strlen(c[i]);
        if(l<=10)
            printf("%s\n",c[j]);
        else
            printf("%c%d%c\n",c[j][0],l-2,c[j][l-1]);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
    int n,i,j,l;
    printf("Enter the number of words: ");
    scanf("%d",&n);
    printf("Enter %d words: ",n);
    char c[n][100];
    for(i=0;i<n;i++)
    {
        scanf("%s",&c[i]);
    }
    for(j=0;j<i;j++)
    {
        l=strlen(c[j]);
        if(l<=10)
            printf("%s\n",c[j]);
        else
            printf("%c%d%c",c[j][0],l-2,c[j][l-1]);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    int n,i,j,l;
    scanf("%d",&n);
    char c[n][101];
    for(i=0;i<n;i++)
    {
        scanf("%s",&c[i]);
    }
    for(j=0;j<n;j++)
    {
        l=strlen(c[i]);
        if(l<=10)
            printf("%s\n",c[j]);
        else
            printf("%c%d%c\n",c[j][0],l-2,c[j][l-1]);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    long int n,i,j,l;
    printf("Enter the number of words: ");
    scanf("%ld",&n);
    printf("Enter %ld words: ",n);
    char c[n][101];
    for(i=0;i<n;i++)
    {
        scanf("%s",&c[i]);
    }
    for(j=0;j<n;j++)
    {
        l=strlen(c[i]);
        if(l<=10)
            printf("%s\n",c[j]);
        else
            printf("%c%ld%c",c[j][0],l-2,c[j][l-1]);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
    long int n,i,j,l;
    printf("Enter the number of words: ");
    scanf("%ld",&n);
    printf("Enter %ld words: ",n);
    char c[n][100];
    for(i=0;i<n;i++)
    {
        scanf("%s",&c[i]);
    }
    for(j=0;j<n;j++)
    {
        l=strlen(c[j]);
        if(l<=10)
            printf("%s\n",c[j]);
        else
            printf("%c%ld%c",c[j][0],l-2,c[j][l-1]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[500];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l <= 10){
            strings[i] = (char*) malloc (l * sizeof (char));
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 == 9){
                strings[i] = (char*) malloc (l * sizeof (char));
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
                strings[i][3] = '\0';
            }
            else{
                strings[i] = (char*) malloc (l * sizeof (char));
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
                strings[i][4] = '\0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        if (i == n-1){
            printf ("%s", strings[i]);
        }
        else    printf ("%s\n", strings[i]);
    }
    return 0;
}

//


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (100 * sizeof(char*));
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        char ptr[101];
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l <= 10){
            strings[i] = (char*) malloc (100 * sizeof (char));
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 == 9){
                strings[i] = (char*) malloc (100 * sizeof (char));
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
                strings[i][3] = '\0';
            }
            else{
                strings[i] = (char*) malloc (100 * sizeof (char));
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
                strings[i][4] = '\0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        if (i == n-1){
            printf ("%s", strings[i]);
        }
        else    printf ("%s\n", strings[i]);
    }
    free(strings);
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l <= 10){
            strings[i] = (char*) malloc (l * sizeof (char));
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 == 9){
                strings[i] = (char*) malloc (4 * sizeof (char));
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
                strings[i][3] = '\0';
            }
            else{
                strings[i] = (char*) malloc (5 * sizeof (char));
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
                strings[i][4] = '\0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        if (i == n-1){
            printf ("%s", strings[i]);
        }
        else    printf ("%s\n", strings[i]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l <= 10){
            strings[i] = (char*) malloc (l * sizeof (char));
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 < 10){
                strings[i] = (char*) malloc (4 * sizeof (char));
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
            }
            else{
                strings[i] = (char*) malloc (5 * sizeof (char));
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        printf ("%s\n", strings[i]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        strings[i] = (char*) malloc (5 * sizeof (char));
        if (l < 10){
            strcpy (strings[i], ptr);
        }
        else{
            if (l < 100){
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = l % 10;
                strings[i][1] = (l - (l % 10))/10;
            }
            else{
                strings[i][0] = ptr[0];
                strings[i][4] = ptr[l-1];
                strings[i][3] = '0';
                strings[i][2] = '0';
                strings[i][1] = '1';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        printf ("%s\n", strings[i]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l < 10){
            strcpy (strings[i], ptr);
        }
        else{
            if (l < 100){
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = l % 10;
                strings[i][1] = (l - (l % 10))/10;
            }
            else{
                strings[i][0] = ptr[0];
                strings[i][4] = ptr[l-1];
                strings[i][3] = '0';
                strings[i][2] = '0';
                strings[i][1] = '1';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        printf ("%s\n", strings[i]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[500];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l <= 10){
            strings[i] = (char*) malloc (l * sizeof (char));
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 == 9){
                strings[i] = (char*) malloc (l * sizeof (char));
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
                strings[i][3] = '\0';
            }
            else{
                strings[i] = (char*) malloc (l * sizeof (char));
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
                strings[i][4] = '\0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        if (i == n-1){
            printf ("%s", strings[i]);
        }
        else    printf ("%s\n", strings[i]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        strings[i] = (char*) malloc (6 * sizeof (char));
        if (l < 10){
            strcpy (strings[i], ptr);
        }
        else{
            if (l < 100){
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = l % 10;
                strings[i][1] = (l - (l % 10))/10;
            }
            else{
                strings[i][0] = ptr[0];
                strings[i][4] = ptr[l-1];
                strings[i][3] = '0';
                strings[i][2] = '0';
                strings[i][1] = '1';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        printf ("%s\n", strings[i]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[1000];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l <= 10){
            strings[i] = (char*) malloc (l * sizeof (char));
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 == 9){
                strings[i] = (char*) malloc (l * sizeof (char));
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
                strings[i][3] = '\0';
            }
            else{
                strings[i] = (char*) malloc (l * sizeof (char));
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
                strings[i][4] = '\0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        if (i == n-1){
            printf ("%s", strings[i]);
        }
        else    printf ("%s\n", strings[i]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l <= 10){
            strings[i] = (char*) malloc (l * sizeof (char));
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 == 9){
                strings[i] = (char*) malloc (4 * sizeof (char));
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
            }
            else{
                strings[i] = (char*) malloc (5 * sizeof (char));
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        printf ("%s\n", strings[i]);
    }
    return 0;
}
//


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l <= 10){
            strings[i] = (char*) malloc (l * sizeof (char));
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 < 10){
                strings[i] = (char*) malloc (4 * sizeof (char));
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = l-2 + '0';
            }
            else{
                strings[i] = (char*) malloc (5 * sizeof (char));
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        printf ("%s\n", strings[i]);
    }
    return 0;
}
//


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l <= 10){
            strings[i] = (char*) malloc (l * sizeof (char));
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 == 9){
                strings[i] = (char*) malloc (4 * sizeof (char));
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
            }
            else{
                strings[i] = (char*) malloc (5 * sizeof (char));
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        if (i == n-1){
            printf ("%s", strings[i]);
        }
        else    printf ("%s\n", strings[i]);
    }
    return 0;
}
//


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        strings[i] = (char*) malloc (l * sizeof (char));
        if (l <= 10){
            strcpy (strings[i], ptr);
        }
        else{
            if (((l-2) - ((l-2) % 10))/10 == 0){
                int a = ((l-2) % 10);
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
            }
            else{
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        printf ("%s\n", strings[i]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l <= 10){
            strings[i] = (char*) malloc (l * sizeof (char));
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 == 9){
                strings[i] = (char*) malloc (l * sizeof (char));
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
                strings[i][3] = '\0';
            }
            else{
                strings[i] = (char*) malloc (l * sizeof (char));
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
                strings[i][4] = '\0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        if (i == n-1){
            printf ("%s", strings[i]);
        }
        else    printf ("%s\n", strings[i]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        strings[i] = (char*) malloc (l * sizeof (char));
        if (l <= 10){
            strcpy (strings[i], ptr);
        }
        else{
            if (((l-2) - ((l-2) % 10))/10 == 0){
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
            }
            else{
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        printf ("%s\n", strings[i]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l <= 10){
            strings[i] = (char*) malloc (l * sizeof (char));
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 == 9){
                strings[i] = (char*) malloc (4 * sizeof (char));
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
            }
            else{
                strings[i] = (char*) malloc (5 * sizeof (char));
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        if (i == n-1){
            printf ("%s", strings[i]);
        }
        else    printf ("%s\n", strings[i]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        strings[i] = (char*) malloc (l * sizeof (char));
        if (l <= 10){
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 < 10){
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = '9';
            }
            else{
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        printf ("%s\n", strings[i]);
    }
    return 0;
}


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

int main()
{
    int n = 0;
    scanf ("%d", &n);
    char** strings = (char**) malloc (n * sizeof(char*));
    char ptr[101];
    int l = 0;
    for (int i = 0; i < n; ++i)
    {
        scanf ("%s", ptr);
        l = strlen (ptr);
        if (l <= 10){
            strings[i] = (char*) malloc (l * sizeof (char));
            strcpy (strings[i], ptr);
        }
        else{
            if (l-2 < 10){
                strings[i] = (char*) malloc (4 * sizeof (char));
                strings[i][0] = ptr[0];
                strings[i][2] = ptr[l-1];
                strings[i][1] = l-2 + '0';
            }
            else{
                strings[i] = (char*) malloc (5 * sizeof (char));
                int a, b;
                a = ((l-2) % 10);
                b = (((l-2) - ((l-2) % 10))/10);
                strings[i][0] = ptr[0];
                strings[i][3] = ptr[l-1];
                strings[i][2] = a + '0';
                strings[i][1] = b + '0';
            }
        }
    }
    for (int i = 0; i < n; ++i){
        printf ("%s\n", strings[i]);
    }
    return 0;
}


#include<stdio.h>
#include<ctype.h>
int main(){
    int n,i,m;
char x[6000];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%s",&x);
int l=strlen(x);

if(l>10){

    printf("%c",x[0]);
    printf("%d",l-2);
    printf("%c\n",x[l-1]);

}
else printf("%s\n",x);}
return 0;
}


#include<stdio.h>
int main()
{
    int count,e
    char s[100],n,d;
    scanf("%s",&s);
    for(i=0;s[i]!='\0';i++)
    {
        n=s[0];
        count++;
    }
    d=s[i];
    e=count-1;
    printf("%c%d%c",n,e,d);
}


#include<stdio.h>
int main()
{
    int count,e,i,m;
    char s[100],n,d;
    scanf("%d",&m);
    for(i=0;i<m;i++)
    scanf("%s",s);
    for(i=0;s[i]!='\0';i++)
    {
        n=s[0];
        count++;
        if(count<4)
        {
            printf("%s",s);
        }
    else
    {
    d=s[i];
    e=count-1;
    printf("%c%d%c",n,e,d);
    printf("\N");
}
}
return 0;
}


#include<stdio.h>
int main()
{
    int count,e,i;
    char s[100],n,d;
    scanf("%s",s);
    for(i=0;s[i]!='\0';i++)
    {
        n=s[0];
        count++;
    }
    d=s[i];
    e=count-1;
    printf("%c%d%c",n,e,d);
    return 0;
}


#include<stdio.h>
int main()
{
    int count,e,i,m;
    char s[100],n,d;
    scanf("%d",&m);
    for(i=0;i<m;i++)
    scanf("%s",s);
    for(i=0;s[i]!='\0';i++)
    {
        n=s[0];
        count++;
        if(count<4)
        {
            printf("%s",s);
        }
    else
    {
    d=s[i];
    e=count-1;
    printf("%c%d%c",n,e,d);
    printf("\N")
}
}
return 0;
}


#include<stdio.h>
int main()
{
    int count,e,i,m;
    char s[100],n,d;
    scanf("%d",&m);
    for(i=0;i<m;i++)
    scanf("%s",s);
    for(i=0;s[i]!='\0';i++)
    {
        n=s[0];
        count++;
        if(count<4)
        {
            printf("%s",s);
        }
    }
    else
    {
    d=s[i];
    e=count-1;
    printf("%c%d%c",n,e,d);
}
return 0;
}


#include<stdio.h>
int main()
{
    int count,e;
    char s[100],n,d;
    scanf("%s",s);
    for(i=0;s[i]!='\0';i++)
    {
        n=s[0];
        count++;
    }
    d=s[i];
    e=count-1;
    printf("%c%d%c",n,e,d);
}


#include<stdio.h>
int main()
{
    int count,e
    char s[100],n,d;
    scanf("%s",s);
    for(i=0;s[i]!='\0';i++)
    {
        n=s[0];
        count++;
    }
    d=s[i];
    e=count-1;
    printf("%c%d%c",n,e,d);
}


#include<stdio.h>
int main()
{
    int count,e,i,m;
    char s[100],n,d;
    scanf("%d",&m);
    for(i=0;i<m;i++)
    scanf("%s",s);
    for(i=0;s[i]!='\0';i++)
    {
        n=s[0];
        count++;
        if(count<4)
        {
            printf("%s",s);
        }
    else
    {
    d=s[i];
    e=count-1;
    printf("%c%d%c",n,e,d);
}
}
return 0;
}


#include<stdio.h>
int main()
{
    int count,e,i,m;
    char s[100],n,d;
    scanf("%d",&m);
    for(i=0;i<m;i++)
    scanf("%s",s);
    for(i=0;s[i]!='\0';i++)
    {
        n=s[0];
        count++;
        if(count<4)
        {
            printf("%d",count);
        }
    else
    {
    d=s[i];
    e=count-1;
    printf("%c%d%c\N",n,e,d);
}
}
return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
    int n,i,l;
    scanf("%d",&n);
    char a[n][100];
    for(i=0;i<n;i++)
    {
        scanf("%s",a[i]);
    }

    for(i=0;i<n;i++)
    {
        printf("\n");
        l=strlen(a[i]);
        if(l>10 )
        {
            printf("%c%d%c",a[i][0],l-2,a[i][l-1]);
            l=0;
        }
        else printf("%s",a[i]);

    }

    return 0;

}


#include<stdio.h>
#include<string.h>
int main()
{
    int n,i,l;
    int x,y;
    scanf("%d",&n);
    char a[n][100],c[n][100];
    int b[n];
    for(i=0;i<n;i++)
    {
        scanf("%s",a[i]);
    }

    for(i=0;i<n;i++)
    {
        l=strlen(a[i]);
        if(l>10 )
        {

            y=l-2;
            x=l-1;
            printf("%c%d%c",a[i][0],y,a[i][x]);
            l=0;
        }
        else printf("%s",a[i]);
        //printf("\n");
    }

    return 0;

}


#include<stdio.h>
#include<string.h>
int main()
{
    int n,i,l;
    int x,y;
    scanf("%d",&n);
    char a[n][100],c[n][100];
    int b[n];
    for(i=0;i<n;i++)
    {
        scanf("%s",a[i]);
    }

    for(i=0;i<n;i++)
    {
        l=strlen(a[i]);
        if(l>10 )
        {

            y=l-2;
            x=l-1;
            printf("\n%c%d%c",a[i][0],y,a[i][x]);
            l=0;
        }
        else printf("\n%s",a[i]);
    }

}


#include<stdio.h>
#include<string.h>
int main()
{
    int n,i,l;
    int x,y;
    scanf("%d",&n);
    char a[n][100];
    for(i=0;i<n;i++)
    {
        scanf("%s",a[i]);
    }

    for(i=0;i<n;i++)
    {
        l=strlen(a[i]);
        if(l>10 )
        {

            y=l-2;
            x=l-1;
            printf("%c%d%c",a[i][0],y,a[i][x]);
            l=0;
        }
        else printf("%s",a[i]);
        printf("\n");
    }

    return 0;

}


#include<stdio.h>
#include<string.h>
int main()
{
    int n,i,l;
    scanf("%d",&n);
    char a[n][100];
    /*for(i=0;i<n;i++)
    {
        scanf("%s",a[i]);
    }*/

    for(i=0;i<n;i++)
    {

         scanf("%s",a[i]);
        l=strlen(a[i]);
        if(l>10 )
        {
            printf("%c%d%c",a[i][0],l-2,a[i][l-1]);
            l=0;
        }
        else printf("%s",a[i]);
        printf("\n");

    }

    return 0;

}


#include<stdio.h>
#include<string.h>
int main()
{
    int n,i,l;
    int x,y;
    scanf("%d",&n);
    char a[n][100];
    for(i=0;i<n;i++)
    {
        scanf("%s",a[i]);
    }

    for(i=0;i<n;i++)
    {
        l=strlen(a[i]);
        if(l>10 )
        {

            y=l-2;
            x=l-1;
            printf("%c %d %c",a[i][0],y,a[i][x]);
            l=0;
        }
        else printf("%s",a[i]);
        printf("\n");
    }

    return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n,t,x;
int main()
{
    scanf("%d",&t);
    int sum = 0;
    int f;
    while(t--)
    {
        f = 1;
        sum = 0;
        scanf("%d%d",&n,&x);
        for(int i = 0; i < n; i++)
        {
            int t1;
            scanf("%d",&t1);
            if(t1 != x)
                f = 0;
            sum += t1;
        }
        if(f == 1)
        {
            printf("0\n");
        }
        else if(sum % x == 0)
        {
            printf("%d\n",1);
        }
        else
        {
            printf("%d\n",2);
        }
    }
    return 0;
}


#include<iostream>
#define ll long long int
using namespace std;

int main()
{
	ll t;
	cin>>t;
	while(t--)
	{
		ll n,k;
		cin>>n>>k;
		ll a[n];ll f=0;
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			if(a[i]==k)
				f=1;
		}
		if(f==1)
		{
			cout<<f<<endl;
			continue;
		}
		ll sum=0;
		for(ll i=0;i<n-1;i++)
		{
			ll s=k-a[i];
			sum+=s;
		}
		a[n-1]-=sum;
		if(a[n-1]==k)
		{
			if(sum==0)
				cout<<0<<endl;
			else
				cout<<1<<endl;
		}
		else
			cout<<2<<endl;
	}
}


#include<iostream>
#define ll long long int
using namespace std;

int main()
{
	ll t;
	cin>>t;
	while(t--)
	{
		ll n,k;
		cin>>n>>k;
		ll a[n];
		for(ll i=0;i<n;i++)
			cin>>a[i];
		ll sum=0;
		for(ll i=0;i<n-1;i++)
		{
			ll s=k-a[i];
			sum+=s;
		}
		a[n-1]-=sum;
		if(a[n-1]==k)
		{
			if(sum==0)
				cout<<0<<endl;
			else
				cout<<1<<endl;
		}
		else
			cout<<2<<endl;
	}
}


#include<iostream>
#define ll long long int
using namespace std;

int main()
{
	ll t;
	cin>>t;
	while(t--)
	{
		ll n,k;
		cin>>n>>k;
		ll a[n];ll f=0;
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			if(a[i]==k)
				f=1;
		}
		ll sum=0;ll sum_t=0;
		for(ll i=0;i<n-1;i++)
		{
			ll s=k-a[i];
			sum+=s;
			sum_t+=a[i];
		}
		a[n-1]-=sum;
		if(a[n-1]==k)
		{
			if(sum_t==(k*(n-1)))
				cout<<0<<endl;
			else
				cout<<1<<endl;
		}
		else
		{
			if(f==1)
				cout<<f<<endl;
			else
				cout<<2<<endl;
		}
	}
}


#include<iostream>
#define ll long long int
using namespace std;

int main()
{
	ll t;
	cin>>t;
	while(t--)
	{
		ll n,k;
		cin>>n>>k;
		ll a[n];ll f=0;
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			if(a[i]==k)
				f=1;
		}
		ll sum=0;ll sum_t=0;
		for(ll i=0;i<n-1;i++)
		{
			ll s=k-a[i];
			sum+=s;
			if(a[i]!=a[i+1])
				sum_t=1;
		}
		a[n-1]-=sum;
		if(a[n-1]==k)
		{
			if(!sum_t)
				cout<<0<<endl;
			else
				cout<<1<<endl;
		}
		else
		{
			if(f==1)
				cout<<f<<endl;
			else
				cout<<2<<endl;
		}
	}
}


#include<iostream>
#define ll long long int
using namespace std;

int main()
{
	ll t;
	cin>>t;
	while(t--)
	{
		ll n,k;
		cin>>n>>k;
		ll a[n];ll f=0;
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			if(a[i]==k)
				f=1;
		}
		ll sum=0;
		for(ll i=0;i<n-1;i++)
		{
			ll s=k-a[i];
			sum+=s;
		}
		a[n-1]-=sum;
		if(a[n-1]==k)
		{
			if(sum==0)
				cout<<0<<endl;
			else
				cout<<1<<endl;
		}
		else
		{
			if(f==1)
				cout<<f<<endl;
			else
				cout<<2<<endl;
		}
	}
}


#include <iostream>
#include <stdio.h>
using namespace std;
int t;int n;
int a[10004];int x;

int main()
{
    scanf("%d",&t);
    while(t--){
        scanf("%d%d",&n,&x);
        for(int i=0;i<n;i++){
            scanf("%d",&a[i]);
        }
        int sign=0;int ans;
        for(int i=0;i<n;i++){
            if(a[i]!=x){sign++;break;}
        }
        if(sign==0){
            printf("0\n");continue;
        }else if(sign==1){
            printf("1\n");continue;
        }
        int sum=0;
        for(int i=0;i<n;i++){
            sum+=a[i]-x;
        }
        if(sum==0){
            printf("1\n");continue;
        }
        printf("2\n");

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 1e3+10;

int a[N];
int n,k;

int main(){
	init();
	int cas;cin>>cas;
	while(cas--){
		scanf("%d%d",&n,&k);
		for(int i=1;i<=n;i++) scanf("%d",a+i);
		int f1=0,f2=0,sum=0;
		for(int i=1;i<=n;i++){
			sum+=a[i];
			if(a[i]!=k) f1=1;
			if(a[i]==k) f2=1;
		}
		if(!f1) puts("0");
		else if(f2||sum==n*k) puts("1");
		else puts("2");
	}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
const int maxn = 1009;
int T;
int n, x, a[maxn],ave = 0, tot = 0;
int main() {
  cin >> T;
  while (T--) {
    cin >> n >> x;
    ave = 0;
    tot = 0;
    for (int i = 1; i <= n; ++i) scanf("%d", a + i);
    for (int i = 1; i <= n; ++i) {
      ave += a[i];
      if (a[i] == x) tot++;
    }
    if (tot == n) {
      cout << 0 << endl;
      continue;
    }
    if (!(ave % n) && ave / n == x) {
      cout << 1 << endl;
      continue;
    }
    if (tot > 0) cout << 1 << endl;
    else cout << 2 << endl;
  }
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define cs const
#define fr first
#define se second
#define ls (now<<1)
#define mid ((l+r)>>1)
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define low(i) (i&(-i))
#define par pair<int,int>
#define cn(x) memset(x, 0, sizeof(x))
#define rep(i, x, y) for(int i=x; i<=y; ++i)
#define sep(i, x, y) for(int i=x; i>=y; --i)
#define fore(i, x) for(int i=fir[x]; i; i=nex[i])

cs int G = 3;
cs int ff = 1e6 + 15;
cs int inf = 1e18 + 1;
cs int base = 2333;
cs int M = 1e9 + 7;
cs double eps = 1e-15;

int n, x, a[ff];
void init()
{
	int tag = 1, s = 0, cnt = 0;
	scanf("%lld %lld", &n, &x);
	rep(i, 1, n)
	{
		scanf("%lld", &a[i]), tag &= (a[i] == x);
		if(a[i] != x) s += a[i], cnt ++;
	}
	if(tag) { cout << "0\n"; return; }
	if(s == x * cnt || cnt != n) {cout << "1\n"; return;}
	cout << "2\n";
}
signed main()
{
//	freopen("candy.in", "r", stdin);
//	freopen("candy.out", "w", stdout);
	int Ts = 1;
	cin >> Ts;
	while(Ts--)
		init();
}


#include <bits/stdc++.h>
using namespace std;
inline int read(){
	int x;
    x=0;char ch=0;bool sign=false;
    while(ch < '0' || ch > '9'){
        sign|=(ch == '-');
        ch=getchar();
    }
    while(!(ch < '0' || ch > '9')){
        x=x*10+(ch^48);
        ch=getchar();
    }
    x=sign ? -x : x;
    return x;
}

inline void print(int x){
    if(x<0)putchar('-'),x=-x;
    if(x>9)print(x/10);
    putchar(x%10+'0');
}
int a[1003];
int main(){
	int T=read();
	while(T--){
		int n=read(),x=read();
		long long sum=0;
		int f=1,t=0;
		for(int i=1; i<=n; i++){
			a[i]=read();
			if(a[i]!=x) f=0; else ++t;
			sum+=a[i];
		}
		sort(a+1,a+n+1);
		if(f) puts("0"); else
		if(sum==1ll*x*n) puts("1");
		else if(t) puts("1");
		else puts("2");
	}
	return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;
int t;int n;
int a[10004];int x;

int main()
{
    scanf("%d",&t);
    while(t--){
        scanf("%d%d",&n,&x);
        for(int i=0;i<n;i++){
            scanf("%d",&a[i]);
        }
        int sign=0;int ans;
        for(int i=0;i<n;i++){
            if(a[i]!=x){sign=1;break;}
        }
        if(sign==0){
            printf("0\n");continue;
        }
        int sum=0;
        for(int i=0;i<n;i++){
            sum+=a[i]-x;
        }
        if(sum==0){
            printf("1\n");continue;
        }
        printf("2\n");

    }

    return 0;
}


#include <cstdio>
int t, n, x, a, avrg, flag;
int main(){
	scanf("%d", &t);
	while (t--){
		scanf("%d%d", &n, &x);
		avrg = 0; flag = 1;
		for (int i = 1; i <= n; i++){
			scanf("%d", &a);
			if (a != x) flag = 0;
			avrg += a;
		}
		avrg /= n;
		if (flag) printf("0\n");
		else if (avrg == x) printf("1\n");
		else printf("2\n");
	}
	return 0;
}


 #pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
namespace in{
	char buf[1<<21],*p1=buf,*p2=buf;
	inline int getc(){
	    return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;
	}
	template <typename T>inline void read(T& t){
	    t=0;int f=0;char ch=getc();
	    while (!isdigit(ch)){
	        if(ch=='-')f = 1;
	        ch=getc();
	    }
	    while(isdigit(ch)){
   	    	t=t*10+ch-48;
   	    	ch = getc();
   		}
		if(f)t=-t;
	}
	template <typename T,typename... Args> inline void read(T& t, Args&... args){
	    read(t);read(args...);
	}
}
namespace out{
	char buffer[1<<21];
	int p1=-1;
	const int p2 = (1<<21)-1;
	inline void flush() {
		fwrite(buffer,1,p1+1,stdout),
		p1=-1;
	}
	inline void putc(const char &x) {
		if(p1==p2)flush();
		buffer[++p1]=x;
	}
	template <typename T>void write(T x) {
		static char buf[15];
		static int len=-1;
		if(x>=0){
			do{
    			buf[++len]=x%10+48,x/=10;
    		}while (x);
		}else{
    		putc('-');
			do {
    			buf[++len]=-(x%10)+48,x/=10;
			}while(x);
		}
		while (len>=0)
			putc(buf[len]),--len;
	}
}
using namespace std;
int t,n,x;
int num[3000];
int sumx,sumd;
signed main(){
	in::read(t);
	while(t--){
		sumx=sumd=0;
		in::read(n,x);
		for(int i=1;i<=n;i++){
			in::read(num[i]);
			if(num[i]<x)sumx+=x-num[i];
			else if(num[i]>x)sumd+=num[i]-x;
		}
		if(sumx==0&&sumd==0)puts("0");
		else if(sumx==0||sumd==0)puts("1");
		else if(sumx==sumd)puts("1");
		else puts("2");
	}
	out::flush();
	return 0;
}


#include<bits/stdc++.h>
namespace in{
	char buf[1<<21],*p1=buf,*p2=buf;
	inline int getc(){
	    return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;
	}
	template <typename T>inline void read(T& t){
	    t=0;int f=0;char ch=getc();
	    while (!isdigit(ch)){
	        if(ch=='-')f = 1;
	        ch=getc();
	    }
	    while(isdigit(ch)){
   	    	t=t*10+ch-48;
   	    	ch = getc();
   		}
		if(f)t=-t;
	}
	template <typename T,typename... Args> inline void read(T& t, Args&... args){
	    read(t);read(args...);
	}
}
using namespace std;
#define int long long
int t,n,x;
int num;
int sumx,sumd,eq;
signed main(){
	in::read(t);
	while(t--){
		sumx=sumd=eq=0;
		in::read(n,x);
		for(int i=1;i<=n;i++){
			in::read(num);
			if(num<x)sumx+=x-num;
			if(num>x)sumd+=num-x;
			if(num==x)eq++;
		}
		if(eq==n)puts("0");
		else if(eq)puts("1");
		else if(sumx==0||sumd==0)puts("1");
		else if(sumx==sumd)puts("1");
		else puts("2");
	}
	return 0;
}


 #pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
namespace in{
	char buf[1<<21],*p1=buf,*p2=buf;
	inline int getc(){
	    return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;
	}
	template <typename T>inline void read(T& t){
	    t=0;int f=0;char ch=getc();
	    while (!isdigit(ch)){
	        if(ch=='-')f = 1;
	        ch=getc();
	    }
	    while(isdigit(ch)){
   	    	t=t*10+ch-48;
   	    	ch = getc();
   		}
		if(f)t=-t;
	}
	template <typename T,typename... Args> inline void read(T& t, Args&... args){
	    read(t);read(args...);
	}
}
namespace out{
	char buffer[1<<21];
	int p1=-1;
	const int p2 = (1<<21)-1;
	inline void flush() {
		fwrite(buffer,1,p1+1,stdout),
		p1=-1;
	}
	inline void putc(const char &x) {
		if(p1==p2)flush();
		buffer[++p1]=x;
	}
	template <typename T>void write(T x) {
		static char buf[15];
		static int len=-1;
		if(x>=0){
			do{
    			buf[++len]=x%10+48,x/=10;
    		}while (x);
		}else{
    		putc('-');
			do {
    			buf[++len]=-(x%10)+48,x/=10;
			}while(x);
		}
		while (len>=0)
			putc(buf[len]),--len;
	}
}
using namespace std;
int t,n,x;
int num[3000];
int sumx,sumd;
signed main(){
	in::read(t);
	while(t--){
		sumx=sumd=0;
		in::read(n,x);
		for(int i=1;i<=n;i++){
			in::read(num[i]);
			if(num[i]<x)sumx+=x-num[i];
			else if(num[i]>x)sumd+=num[i]-x;
		}
		if(sumx==0&&sumd==0)puts("0");
		else if(sumx==sumd)puts("1");
		else puts("2");
	}
	out::flush();
	return 0;
}


 #pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
namespace in{
	char buf[1<<21],*p1=buf,*p2=buf;
	inline int getc(){
	    return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;
	}
	template <typename T>inline void read(T& t){
	    t=0;int f=0;char ch=getc();
	    while (!isdigit(ch)){
	        if(ch=='-')f = 1;
	        ch=getc();
	    }
	    while(isdigit(ch)){
   	    	t=t*10+ch-48;
   	    	ch = getc();
   		}
		if(f)t=-t;
	}
	template <typename T,typename... Args> inline void read(T& t, Args&... args){
	    read(t);read(args...);
	}
}
namespace out{
	char buffer[1<<21];
	int p1=-1;
	const int p2 = (1<<21)-1;
	inline void flush() {
		fwrite(buffer,1,p1+1,stdout),
		p1=-1;
	}
	inline void putc(const char &x) {
		if(p1==p2)flush();
		buffer[++p1]=x;
	}
	template <typename T>void write(T x) {
		static char buf[15];
		static int len=-1;
		if(x>=0){
			do{
    			buf[++len]=x%10+48,x/=10;
    		}while (x);
		}else{
    		putc('-');
			do {
    			buf[++len]=-(x%10)+48,x/=10;
			}while(x);
		}
		while (len>=0)
			putc(buf[len]),--len;
	}
}
using namespace std;
int t,n,x;
int num[3000];
int sumx,sumd,eq;
signed main(){
	in::read(t);
	while(t--){
		sumx=sumd=eq=0;
		in::read(n,x);
		for(int i=1;i<=n;i++){
			in::read(num[i]);
			if(num[i]<x)sumx+=x-num[i];
			if(num[i]>x)sumd+=num[i]-x;
			if(num[i]==x)eq++;
		}
		if(sumx==0&&sumd==0)puts("0");
		else if(sumx==0||sumd==0)puts("1");
		else if(sumx==sumd)puts("1");
		else if(eq>=2)puts("1");
		else puts("2");
	}
	out::flush();
	return 0;
}