Problem: Ringo has a string S.

He can perform the following N kinds of operations any number of times in any order.

* Operation i: For each of the characters from the L_i-th through the R_i-th characters in S, replace it with its succeeding letter in the English alphabet. (That is, replace `a` with `b`, replace `b` with `c` and so on.) For `z`, we assume that its succeeding letter is `a`.



Ringo loves palindromes and wants to turn S into a palindrome. Determine whether this is possible.

Constraints

* 1 \leq |S| \leq 10^5
* S consists of lowercase English letters.
* 1 \leq N \leq 10^5
* 1 \leq L_i \leq R_i \leq |S|

Input

Input is given from Standard Input in the following format:


S
N
L_1 R_1
L_2 R_2
:
L_N R_N


Output

Print `YES` if it is possible to turn S into a palindrome; print `NO` if it is impossible.

Examples

Input

bixzja
2
2 3
3 6


Output

YES


Input

abc
1
2 2


Output

NO


Input

cassert
4
1 2
3 4
1 1
2 2


Output

YES

Solution (in CPP):

Solution:
#include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#include <complex>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<long double,long double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-10;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

const int M=26;
int S,n;
string s;
vi a,b;
vvi g;

void Add(int u,int v){
	g[u].push_back(v);
	g[v].push_back(u);
}

int dfs(int v){
	b[v]=1;
	int res=a[v];
	for(int i=0;i<g[v].size();i++){
		int u=g[v][i];
		if(!b[u]) res+=dfs(u);
	}
	return res;
}

int main(){
	cin>>s>>n;
	S=s.size();
	a=b=vi(S+1);
	g=vvi(S+1);
	for(int i=0;i<=S;i++){
		char c=(i<S?s[i]:'a'),c_=(i>0?s[i-1]:'a');
		a[i]=(c-c_+M)%M;
		if(i<(S+1)/2) Add(i,S-i);
	}
	for(int i=0;i<n;i++){
		int u,v;
		cin>>u>>v;
		Add(u-1,v);
	}
	bool B=1;
	for(int i=0;i<=S;i++) if(!b[i]&&dfs(i)%M!=0) B=0;
	cout<<(B?"YES":"NO")<<endl;
}