#include <iostream>
#include <string>
#include <fstream>
using namespace std;

int main()
{
	ifstream ff("file.txt");
	int n, p;
	cin>>n>>p;
	n+=4;
	char *s2 = new char[n];
	s2[0]='*';
	s2[1]='#';
	s2[n-1]='=';
	s2[n-2]='+';
	for(int i=2; i<n-2; i++)  cin>>s2[i];
	int Max = 97+p-1;
	//cout<<(char)Max<<endl;
	char C;
	int idx;
	bool b2=false;
	for(int i=n-3; i>=2; i--)
	{
line1:

		if(s2[i]>=(char)Max) continue;
		C = (int)++s2[i];

		//cout<<C<<endl;
		if(C==s2[i-1] || C==s2[i-2])
		{
			goto line1;
		}
		else
		{
			s2[i]=C;
			idx=i;
			b2=true;
			break;
		}
		//cout<<C<<endl;
	}
	if(b2==false)
	{
		cout<<"NO"<<endl;
		return 0;
	}
	int kol=0;
	for(int i=idx+1; i<n-2; i++)
	{
		kol=0;
line2:
		if(kol==p)
		{
			cout<<"NO"<<endl;
			return 0;
		}
		kol++;
		C = (int)++s2[i];
		if(C>(char)Max)
		{
			C='a';
		}
		if(C==s2[i+1] || C==s2[i+2] || C==s2[i-1] || C==s2[i-2])
		{
			goto line2;
		}
		else
		{
			s2[i]=C;
			idx=i;
			break;
		}
		//cout<<C<<endl;
	}

	for(int i=2; i<n-2; i++)
	{
		cout<<s2[i];
	}

	return 0;
}


#include <iostream>
# include <vector>
# include<algorithm>
# include <string>
using namespace std;
int n,k;
string s;
bool check(int idx)
{
    bool a[26]={0};
    if (idx>=1)
        a[(int)s[idx-1]-'a']=1;
    if (idx>=2)
        a[(int)s[idx-2]-'a']=1;
    int now=(int)s[idx]-'a';
    now++;
    for (int i=now;i<k;i++)
    {
        if (a[i]==0)
        {
            s[idx]=char(i+97);
            return 1;
        }
    }
    return 0;
}
bool rep(int idx)
{
    bool a[26]={0};
    if (idx>=1)
        a[(int)s[idx-1]-'a']=1;
    if (idx>=2)
        a[(int)s[idx-2]-'a']=1;
    for (int i=0;i<k;i++)
    {
        if (a[i]==0)
        {
            s[idx]=char(i)+'a';
            return 1;
        }
    }
    return 0;
}
int main()
{
    cin>>n>>k;
    cin>>s;
    int h=-1;
    for (int i=n-1;i>=0;i--)
    {
        if (check(i))
        {
            h=i+1;
            break;
        }
    }
    if (h==-1)
        cout<<"NO"<<endl;
    else
    {

        for (int i=h;i<n;i++)
        {
            if (!rep(i))
            {
                cout<<"NO"<<endl;
                return 0;
            }
        }
        cout<<s<<endl;
    }
}


#include <iostream>
#include <string>
using namespace std;

int main()
{
	int n, p; cin >> n >> p;
	if (p < 3)
	{
		cout << "NO";
		return 0;
	}
	string s; cin >> s;
	p += 'a';
	int f = 1;
	int i = s.size() - 1;
	while (f && i > 1)
	{
		for (int j = s[i] + 1; j < p; ++j)
			if (s[i - 1] != j && s[i - 2] != j)
			{
				f = 0;
				s[i] = j;
				i++;
				break;
			}
		i--;
	}
	if (f && i == 1)
	{
		for (int j = s[1] + 1; j < p; ++j)
			if (s[0] != j)
			{
				f = 0;
				s[1] = j;
				i = 1;
				break;
			}
	}
	if (f)
	{
	if (s[0] + 1 >= p)
	{
		cout << "NO";
		return 0;
	}
	else
	{
		s[0] += 1;
		s[1] = 'a';
		i = 1;
		f = 0;
	}
	}
	for (int j = i + 1; j < s.size(); ++j)
	{
		for (int k = 'a'; k < p; ++k)
			if (s[j - 1] != k && s[j - 2] != k)
			{
				s[j] = k;
				break;
			}
	}
	cout << s;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main()
{
	int n, p; cin >> n >> p;
	string s; cin >> s;
	p += 'a';
	int f = 1;
	int i = s.size() - 1;
	while (f && i > 1)
	{
		for (int j = s[i] + 1; j < p; ++j)
			if (s[i - 1] != j && s[i - 2] != j)
			{
				f = 0;
				s[i] = j;
				i++;
				break;
			}
		i--;
	}
	if (f && i == 1)
	{
		for (int j = s[1] + 1; j < p; ++j)
			if (s[0] != j)
			{
				f = 0;
				s[1] = j;
				i = 1;
				break;
			}
	}
	if (f)
	{
	if (s[0] + 1 >= p)
	{
		cout << "NO";
		return 0;
	}
	else
	{
		s[0] += 1;
		s[1] = 'a';
		i = 1;
		f = 0;
	}
	}
	for (int j = i + 1; j < s.size(); ++j)
	{
		for (int k = 'a'; k < p; ++k)
			if (s[j - 1] != k && s[j - 2] != k)
			{
				s[j] = k;
				break;
			}
	}
	cout << s;
	return 0;
}


//---------------------------------------------------------------------------

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

const int SIZE = 100005;

int n, p;

char v[SIZE];

void vvv(int pos);
void inc(int pos);

void vvv(int pos)
{
        while (pos > -1 && v[pos] >= p)
        {
                if (pos == 0)
                {
                        printf("NO");
                        exit(0);
                }
                v[pos] = 'a';
                --pos;
                inc(pos);
        }
}

void inc(int pos)
{
        do
        {
                ++v[pos];
                vvv(pos);
        }while (pos > -1 && (v[pos - 1] == v[pos] || v[pos - 2] == v[pos]));
}

int main(int argc, char* argv[])
{
        char ch;
        scanf("%d%d%c", &n, &p, &ch);
        p+= 'a';
        for (int i = 0; i < n; ++i)
        {
                scanf("%c", &ch);
                v[i] = ch;
        }

        inc(n - 1);
        /*if (pos == -1)
        {
                printf("NO\n");
        }
        else
        {
                printf("%s\n", v);
        }  */
        printf("%s\n", v);
        return 0;
}
//---------------------------------------------------------------------------


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

char str[1001];
char ans[1001];

int main()
{
    int n,p;
    scanf("%d %d",&n,&p);
    getchar();
    int i,j,k;
    scanf("%s",str);
    strcpy(ans,str);
    int flag = 0;
    for(i = n-1; i >= 0; i --)
    {
        for(j = str[i] + 1; j <= 'a' + p-1; j ++)
        {
            if(i > 1 && str[i-1] != j && str[i-2] != j)
            {
                ans[i] = j;
                break;
            }
            if(i == 1 && str[i-1] != j)
            {
                ans[i] = j;
                break;
            }
            if(i == 0)
            {
                ans[i] = j;
                break;
            }
        }

        if(j == 'a' + p) continue;  // 说明第i位找不到合适的字符替换。
        //更新i之后的字符,并满足不出现回文串
        for(k = i +1; k <= n-1; k ++)
        {
            for(j = 'a'; j <= 'a' + p - 1; j ++)
            {
                if(k == 1 && ans[k-1] != j)
                {
                    ans[k] = j;
                    break;
                }
                if(k > 1 && ans[k-1] != j && ans[k-2] != j)
                {
                    ans[k] = j;
                    break;
                }
            }
            if(j == 'a' + p) break;
        }
        if(k == n)
        {
            //找到满足要求的字符串
            flag = 1;
            break;
        }
    }
    if(flag) printf("%s\n",ans);
    else printf("NO\n");

    return 0;
}


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

bool isPali(char * str) //判断是否存在回文
{
    int len = strlen(str);
    int i;
    for(i = 1; i < len; i ++)
    {
        if(str[i] == str[i-1])
            return true;
    }
    for(i = 2; i < len; i ++)
    {
        if(str[i] == str[i-2])
            return true;
    }
    return false;

}

void addOneStr(char *str,int p)
{
    int len = strlen(str);
    int i;
    int c = 1;
    for(i = len-1; i >= 0; i --)
    {
        if(str[i] + c <= 'a'+p-1)
        {
            str[i]  = str[i] + 1;
            break;
        }
        else
        {
            str[i] = 'a';
            c = 1;
        }
    }
}

int main()
{
    int n,p;
    char str[1001];
    while(scanf("%d %d",&n,&p)!=EOF)
    {
        getchar();
        scanf("%s",str);
        int i;
        int c = 0; //进位
        int flag = 0;
        char str1[1001];
        for(i = 0; i < n; i ++)
        {
            str1[i] = 'a' + p-1;
        }
        str1[n] = '\0';
    //  printf("%s\n",str1);
        while(true)
        {
            if(strcmp(str,str1) == 0) break;
            addOneStr(str,p);

        //  printf("%s\n",str);
            if(!isPali(str))
            {
                flag = 1;
                break;
            }
        }
        if(flag == 1) printf("%s\n",str);
        else printf("NO\n");

    }
    return 0;
}


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

bool isPali(char * str) //判断是否存在回文
{
    int len = strlen(str);
    int i;
    for(i = 1; i < len; i ++)
    {
        if(str[i] == str[i-1])
            return true;
    }
    for(i = 2; i < len; i ++)
    {
        if(str[i] == str[i-2])
            return true;
    }
    return false;

}

void addOneStr(char *str,int p)
{
    int len = strlen(str);
    int i;
    int c = 1;
    for(i = len-1; i >= 0; i --)
    {
        if(str[i] + c <= 'a'+p-1)
        {
            str[i]  = str[i] + 1;
            break;
        }
        else
        {
            str[i] = 'a';
            c = 1;
        }
    }
}

int main()
{
    int n,p;
    char str[1001];
    while(scanf("%d %d",&n,&p)!=EOF)
    {
        getchar();
        scanf("%s",str);
        int i;
        int c = 0; //进位
        int flag = 0;
        char str1[1001];
        for(i = 0; i < n; i ++)
        {
            str1[i] = 'a' + p-1;
        }
        str1[n] = '\0';
        while(true)
        {
            addOneStr(str,p);
            if(strcmp(str,str1) == 0) break;
        //  printf("%s\n",str);
            if(!isPali(str))
            {
                flag = 1;
                break;
            }
        }
        if(flag == 1) printf("%s\n",str);
        else printf("NO\n");

    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<string>
#include<cstring>
#include <iomanip>
#include<stack>
#include<set>
#include<vector>
#include<algorithm>
#include<set>
#include<bitset>
#include<map>
#include<queue>
#include<math.h>
using namespace std;
#define mdlo 1000000007
#define maxERR 0.00000064
//#define minVal -10000000000000
#define maxBits 40
#define pi 3.1415926535897932384626433832795
#define INF 999999999999
typedef long long ll;
long long mInv[41];
long long fact[41];
long long factInv[41],M;
typedef pair<long,long>edge;
typedef vector<long>adjList;
long levels[15];
long nextPoint[15];
long firstDigit[15];
bool inTree[1];
bool visited[1];
struct treeInfo{
    long depth;
    long longestPath;
    long startPointOflongestpath;
    long deepestNode;
    bool included;
};
adjList tree[16];
adjList rails[410];
adjList buses[410];
vector<long>startPoints;
//long finalCount[1000106];
adjList graph[15];
long long getmoduloInv(long long n){
    if(n==1)
        return 1;
    if(mInv[n]>0)
        return mInv[n];
    long long m=(-1*mdlo)/n;
    m+=mdlo;
    m*=getmoduloInv(mdlo%n);
    mInv[n]=(m%mdlo);
    return mInv[n];
}
ll par[45];
ll getAncestor(ll val){
    if(par[val]!=val)
        par[val]=getAncestor(par[val]);
    return par[val];
}
bool unify(ll a,ll b){
    ll para=getAncestor(a),parb=getAncestor(b);
    if(para==parb)
        return false;
    if(para<parb)
        par[parb]=para;
    else
        par[para]=parb;
    return true;
}
vector<unsigned long> primes;
vector<unsigned long> get_primes(unsigned long max){

    char *sieve;
    sieve = new char[max/8+1];
    // Fill sieve with 1
    long m=(max/8)+1;
    for(long long i=0;i<m;i++)
        sieve[i]=255;
    for(unsigned long x = 2; x <= max; x++)
        if(sieve[x/8] & (0x01 << (x % 8))){
            primes.push_back(x);
            // Is prime. Mark multiplicates.
            for(unsigned long j = 2*x; j <= max; j += x)
                sieve[j/8] &= ~(0x01 << (j % 8));
        }
    delete[] sieve;
    return primes;
}
double dp[2][2];
long nextRight[2012];
long nextLeft[2012];
ll treepos[20];
ll H,N;
ll h[2],maxvals[6],minvals[2],curMax=-1,curMin=11111111111;
ll lPoint[2],rPoint[2];
long railMatrix[410][410];
bool isPrime(long N){
    if(N==1)
    return false;
    if(N<4)
        return true;
    for(long i=2;i*i<N;i++){
        if(N%i==0)
            return false;
    }
    return true;
}
ll gcd(ll a,ll b){
    ll c;
    if(a>b){
        c=a;
        a=b;
        b=c;
    }
    if(a==0)
        return b;
    c=b%a;
    while(c>0){
        b=a;
        a=c;
        c=b%a;
    }
    return a;
}
long long getLcm(long long a,long long b){
    long long c=a/gcd(a,b);
    return b*c;
}
void buildSegmentTree(long long b,long long e,long long node){
    if(b==e)
    {
        maxvals[node]=h[b];
        minvals[node]=h[b];
         return;
    }
    long long mid=(b+e)/2;
    buildSegmentTree(b,mid,node*2);
    buildSegmentTree(mid+1,e,1+(node*2));
    maxvals[node]=max(maxvals[2*node],maxvals[1+(node*2)]);
    //minvals[node]=min(minvals[2*node],minvals[(1+(2*node))]);
}
ll getMaxelement(ll b, ll e, ll node, ll qb, ll qe){
    if(b>qe||e<qb)
        return 0;
    if(b>=qb&&e<=qe)
        return maxvals[node];
    ll m=(b+e)/2;
    ll f=getMaxelement(b,m,node*2,qb,qe),s=getMaxelement(m+1,e,1+(node*2),qb,qe);
    return max(f,s);
}
ll getMinelement(ll b, ll e, ll node, ll qb, ll qe){
    if(b>qe||e<qb)
        return 10000000000000;
    if(b>=qb&&e<=qe)
        return minvals[node];
    ll m=(b+e)/2;
    ll f=getMinelement(b,m,node*2,qb,qe),s=getMinelement(m+1,e,1+(node*2),qb,qe);
    return min(f,s);
}
ll le,ri;

double angle[1];
vector<ll>nvals;
vector<ll>mvals;
ll n,p;
string s;
bool isValidChar(long pos,char ch){
    if(pos==0)
        return true;
    if(pos==1){
        if(s[0]!=ch)
            return true;
        return false;
    }
    if(s[pos-1]!=ch&&s[pos-2]!=ch)
        return true;
    return false;
}
char nextChar(long pos){
    char lim='a'+p,sChar=s[pos];
    sChar++;
    for(char ch=s[pos]+1;ch<('a'+p);ch++){
        if(isValidChar(pos,ch))
            return ch;
    }
    return s[pos];
}
void buildNext(long startPos){
    if(startPos!=n)
        s[startPos]='a';
    for(long i=startPos+1;i<n;i++){
        if(s[i-1]!='a'&&s[i-2]!='a')
            s[i]='a';
        else if(s[i-2]!='b'&&s[i-2]!='b')
            s[i]='b';
        else
            s[i]='c';
    }
}
int main(void){
//  freopen ("E:/inputSmall.txt","r",stdin);
 //   freopen ("E:/outputSmall2.txt","w",stdout);
    ll test_cases=1;//,C,D,A,L,R,rep,round=0,rem,num;
 //   memset(posOf,-1,sizeof(posOf));
  //double st,en,minerr=0.00000001,r,v;
  //cin>>test_cases>>r>>v;
    cout << setprecision(15) << fixed;
 // buildpwr2(20);
 memset(maxvals,0,sizeof(maxvals));
    ll k,extra,ans=0,cowbells[100005],curSize;

    cin>>n>>p;
    cin>>s;
    bool posible=false;
    if(p==1){
        cout<<"NO"<<endl;
        return 0;
    }
    if(p==2){
        if(s[0]=='b')
            cout<<"NO"<<endl;
        else if(n==2)
            cout<<"ba"<<endl;
        else
            cout<<"b"<<endl;
        return 0;
    }

    for(long i=n-1;i>-1;i--){
        char ch=nextChar(i);
        if(ch!=s[i]){
            s[i]=ch;
            buildNext(i+1);
            cout<<s<<endl;
            return 0;
        }
    }
    cout<<"NO"<<endl;
    return 0;
}
/*ll cumDist1[100005];
ll cumDist2[100005];
vector<ll>distFrom1;
vector<ll>distFrom2;
void initFact(){
    fact[0]=1;
    factInv[0]=1;
    for(ll i=1;i<0;i++){
        factInv[i]=(factInv[i-1]*getmoduloInv(i))%mdlo;
        fact[i]=(fact[i-1]*i)%mdlo;
    }
}
bool isLeapyear(long year){
    if(year%4==0&&(year%100!=0||year%400==0))
        return true;
    return false;
}
ll ds,ms,ys,de,me,ye,dc,mc,yc,day;
void next13th(){
    if(ds<13){
        ds=13;
        return;
    }
    ms++;
    ds=13;
    if(ms>12)
    {
        ms=1;
        ys++;
    }
}
    long months[]={31,28,31,30,31,30,31,31,30,31,30,31};
    long dayBeforeMonth[12];
bool validDate(){
    if(ys>ye)
        return false;
    if(ys<ye)
        return true;
    if(ms>me)
        return false;
    if(ms<me)
        return true;
    if(ds>de)
        return false;
    return true;
}
long getDay(long d,long m,long y){
    long day=((y-1900)*365+(y-1900)/4-(y-1900)/100+(y-1600)/400+dayBeforeMonth[m-1]+d+2)%7;
    if(y%4==0&&m<3){
        if(y%400==0||y%100!=0)
            day=(day+6)%7;
    }
    return day;
}
bool iscurDayFriday(){
    if(getDay(ds,ms,ys)==0)
        return true;
    return false;
}
void dijkstra(long startPoint){
    long m;
    if(startPoint==1)
        m=0;
    else
        m=1;
    distMatrix[m][startPoint]=0;
    priority_queue<edge, vector<edge>,greater <edge>>pq;
    pq.push(edge(0,startPoint));
    while(!pq.empty()){
        edge top=pq.top();
        pq.pop();
        ll d= top.first,u=top.second;
        if(distMatrix[m][u]==d){
            for(long i=0;i<graph[u].size();i++){
                ll v=graph[u][i].second;
                ll ec=graph[u][i].first;
                if(distMatrix[m][v]>distMatrix[m][u]+ec){
                    distMatrix[m][v]=distMatrix[m][u]+ec;
                    pq.push(edge(distMatrix[m][v],v));
                }
            }
        }
    }
}
ll vals[1];
ll dp[1];
ll totalSum[1];
long long mInv[1];
long long fact[1];
long long factInv[1];

//long long pow10[18];
long long getmoduloInv(long long n){
    if(n==1)
        return 1;
    if(mInv[n]>0)
        return mInv[n];
    long long m=(-1*mdlo)/n;
    m+=mdlo;
    m*=getmoduloInv(mdlo%n);
    mInv[n]=(m%mdlo);
    return mInv[n];
}
long long onNthbit(long pos,long val){
    return val|pwr2[pos];
}
bool isNthbitOn(long long pos,long long val){
    return (val&pwr2[pos])>0;
}

seg segTree[5];
long N;
void buildSumSegmentTree(long long b,long long e,long long node){
    if(b==e)
    {
         segTree[node].first=vals[b];
         return;
    }
    long long mid=(b+e)/2;
    buildSumSegmentTree(b,mid,node*2);
    buildSumSegmentTree(mid+1,e,1+(node*2));
    segTree[node].first=segTree[2*node].first+segTree[1+(node*2)].first;
}
long long getSum(long long qStart,long long qEnd,long long sStart,long long sEnd,long long node,prop p){

    long k=sEnd-sStart,n;
    for(long i=0;i<p.size();i++){
        segTree[node].second.push_back(p[i]);
        n=p[i];
        segTree[node].first+=(((n+k)*(n+k+1)*(2*n+2*k+1)-(n*(n-1)*(2*n-1)))/6+((n+k)*(n+k+1)-n*(n-1)))/2;
        }
    if(qEnd<sStart||qStart>sEnd)
    {
        return 0;
    }
    if(sStart>=qStart&&sEnd<=qEnd)
    {
         return segTree[node].first;
    }
    long long sMid=(sStart+sEnd)/2;
    prop l;
    for(long i=0;segTree[node].second.size();i++)
        l.push_back(segTree[node].second[i]+sMid+1-sStart);
    return getSum(qStart,qEnd,sStart,sMid,2*node,segTree[node].second)+getSum(qStart,qEnd,sMid+1,sEnd,1+(2*node),l);
}
long long update(ll node, long long sStart,ll sEnd,long upStart,long upEnd){
    if(upEnd<sStart||upStart>sEnd)
        return 0;
    long k=sEnd-sStart,n=sStart+1-upStart;
    if(upStart<=sStart&&upEnd>=sEnd){
        segTree[node].second.push_back(n);
        segTree[node].first+=(((n+k)*(n+k+1)*(2*n+2*k+1))/6);
        segTree[node].first-=(((n*(n-1)*(2*n-1)))/6);
        segTree[node].first+=(((n+k)*(n+k+1)-n*(n-1)))/2;
        return 0;
    }
    ll sMid=(sStart+sEnd)/2;
    update(node*2,sStart,sMid,upStart,upEnd);
    update(1+(node*2),sMid+1,sEnd,upStart,upEnd);
    segTree[node].first=segTree[2*node].first+segTree[1+(node*2)].first;

    for(long i=0;i<segTree[node].second.size();i++){
        n=segTree[node].second[i];
        segTree[node].first+=(((n+k)*(n+k+1)*(2*n+2*k+1)-(n*(n-1)*(2*n-1)))/6+((n+k)*(n+k+1)-n*(n-1)))/2;
    }
    return segTree[node].first;
}
void update(long x,long y){
    long len=y-x+1,add=0;
    for(long i=0;i<len;i++){
        add+=(i+1)*2;
        update(1,0,N-1,x+i,add+vals[x+i]);
    }
}
long getlen(long long num){
    long len=0;
    while(num>0){
        num/=10;
        len++;
    }
    return len;
}
encryptedLine lineConverter(string s){
    encryptedLine el;
    ll val=0,len=s.size();
    for(long i=0;i<len;i++){
        if(s[i]==' '){
            el.push_back(val);
            val=0;
        }
        else{
            val*=26;
            val+=(s[i]-'a');
        }
    }
    el.push_back(val);
    return el;
}
long getPalinDrome(long num){
    long a=num%10;
    long b=(num/10)%10;
    long c=(num/100)%10;
    return num*1000+a*100+b*10+c;
}

vector<unsigned long> get_primes(unsigned long max){
    vector<unsigned long> primes;
    char *sieve;
    sieve = new char[max/8+1];
    // Fill sieve with 1
    long m=(max/8)+1;
    for(long long i=0;i<m;i++)
        sieve[i]=255;
    for(unsigned long x = 2; x <= max; x++)
        if(sieve[x/8] & (0x01 << (x % 8))){
            primes.push_back(x);
            // Is prime. Mark multiplicates.
            for(unsigned long j = 2*x; j <= max; j += x)
                sieve[j/8] &= ~(0x01 << (j % 8));
        }
    delete[] sieve;
    return primes;
}string add(string a,string b){
    int l1=a.size();
    int l2=b.size();
    while(l1<l2){
        a="0"+a;
        l1++;
    }
    while(l2<l1){
        b="0"+b;
        l2++;
    }
    string s;
    int carry=0;
    for(long i=l2-1;i>-1;i--){
        int d=a[i]+b[i]+carry-2*'0';
        carry=d/10;
        a[i]='0'+(d%10);
    }
    if(carry)
        a="1"+a;
    return a;
}
long long mInv[1010];
long long fact[1000];
long long factInv[1000];
long long getmoduloInv(long long n){
    if(n==1)
        return 1;
    if(mInv[n]>0)
        return mInv[n];
    long long m=(-1*mdlo)/n;
    m+=mdlo;
    m*=getmoduloInv(mdlo%n);
    mInv[n]=(m%mdlo);
    return mInv[n];

}

long dp[200010];
vector<weightedPos>points;
vector<weightedPos>modifiedPositions;
vector<long long>weightPlusPos;
long long segTree[530010];
long N,X,W;
void buildSegTree(long node,long b,long e){
    if(b==e)
        segTree[node]=b;
    else{
        long mid=(b+e)/2;
        buildSegTree(node*2,b,mid);
        buildSegTree(1+node*2,mid+1,e);
        if(weightPlusPos[segTree[node*2]]<=weightPlusPos[segTree[1+node*2]])
            segTree[node]=segTree[node*2];
        else
            segTree[node]=segTree[1+node*2];
    }
}
long long getMin(long node,long segBeg,long segEnd,long qBeg,long qEnd){
    if(segEnd<qBeg||segBeg>qEnd)
        return N;
    if(segBeg>=qBeg&&segEnd<=qEnd)
        return segTree[node];
    long mid=(segBeg+segEnd)/2;
    long fh=getMin(node*2,segBeg,mid,qBeg,qEnd);
    long sh=getMin(1+node*2,mid+1,segEnd,qBeg,qEnd);
    if(weightPlusPos[sh]<weightPlusPos[fh])
        return sh;
    return fh;
}
long long getMinPos(long node,long segBeg,long segEnd,long qBeg,long qEnd){
    if(segEnd<qBeg||segBeg<qEnd)
        return 0;
    if(segBeg>=qBeg&&segEnd<=qEnd)
        return segTree[node];
    long mid=(segBeg+segEnd)/2;
    long fh=getMin(node*2,segBeg,mid,qBeg,qEnd);
    long sh=getMin(node*2,mid+1,segEnd,qBeg,qEnd);
    return min(fh,sh);
}
long getPos(long val){
    long low=0,high=modifiedPositions.size()-1;
    long mid=(low+high)/2;
    while(low<high){
        if(modifiedPositions[mid].first<val)
            low=mid+1;
        else
            high=mid-1;
        mid=(low+high)/2;
    }
    if(mid>0)
        mid--;
    while(mid<modifiedPositions.size()&&modifiedPositions[mid].first<val)
        mid++;
    return mid;
}
long getMaxGroup(long index){
    if(dp[index]>-1)
        return dp[index];
    long pos=getPos(points[index].first+points[index].second);
    if(pos>=N)
        return 1;
    long nextPoint=getMin(1,0,N-1,pos,N-1);
    dp[index]=1+getMaxGroup(nextPoint);
    return dp[index];
}
*/


#include<stdio.h>
#include<iostream>
#include<string>
#include<cstring>
#include <iomanip>
#include<stack>
#include<set>
#include<vector>
#include<algorithm>
#include<set>
#include<bitset>
#include<map>
#include<queue>
#include<math.h>
using namespace std;
#define mdlo 1000000007
#define maxERR 0.00000064
//#define minVal -10000000000000
#define maxBits 40
#define pi 3.1415926535897932384626433832795
#define INF 999999999999
typedef long long ll;
long long mInv[41];
long long fact[41];
long long factInv[41],M;
typedef pair<long,long>edge;
typedef vector<long>adjList;
long levels[15];
long nextPoint[15];
long firstDigit[15];
bool inTree[1];
bool visited[1];
struct treeInfo{
    long depth;
    long longestPath;
    long startPointOflongestpath;
    long deepestNode;
    bool included;
};
adjList tree[16];
adjList rails[410];
adjList buses[410];
vector<long>startPoints;
//long finalCount[1000106];
adjList graph[15];
long long getmoduloInv(long long n){
    if(n==1)
        return 1;
    if(mInv[n]>0)
        return mInv[n];
    long long m=(-1*mdlo)/n;
    m+=mdlo;
    m*=getmoduloInv(mdlo%n);
    mInv[n]=(m%mdlo);
    return mInv[n];
}
ll par[45];
ll getAncestor(ll val){
    if(par[val]!=val)
        par[val]=getAncestor(par[val]);
    return par[val];
}
bool unify(ll a,ll b){
    ll para=getAncestor(a),parb=getAncestor(b);
    if(para==parb)
        return false;
    if(para<parb)
        par[parb]=para;
    else
        par[para]=parb;
    return true;
}
vector<unsigned long> primes;
vector<unsigned long> get_primes(unsigned long max){

    char *sieve;
    sieve = new char[max/8+1];
    // Fill sieve with 1
    long m=(max/8)+1;
    for(long long i=0;i<m;i++)
        sieve[i]=255;
    for(unsigned long x = 2; x <= max; x++)
        if(sieve[x/8] & (0x01 << (x % 8))){
            primes.push_back(x);
            // Is prime. Mark multiplicates.
            for(unsigned long j = 2*x; j <= max; j += x)
                sieve[j/8] &= ~(0x01 << (j % 8));
        }
    delete[] sieve;
    return primes;
}
double dp[2][2];
long nextRight[2012];
long nextLeft[2012];
ll treepos[20];
ll H,N;
ll h[2],maxvals[6],minvals[2],curMax=-1,curMin=11111111111;
ll lPoint[2],rPoint[2];
long railMatrix[410][410];
bool isPrime(long N){
    if(N==1)
    return false;
    if(N<4)
        return true;
    for(long i=2;i*i<N;i++){
        if(N%i==0)
            return false;
    }
    return true;
}
ll gcd(ll a,ll b){
    ll c;
    if(a>b){
        c=a;
        a=b;
        b=c;
    }
    if(a==0)
        return b;
    c=b%a;
    while(c>0){
        b=a;
        a=c;
        c=b%a;
    }
    return a;
}
long long getLcm(long long a,long long b){
    long long c=a/gcd(a,b);
    return b*c;
}
void buildSegmentTree(long long b,long long e,long long node){
    if(b==e)
    {
        maxvals[node]=h[b];
        minvals[node]=h[b];
         return;
    }
    long long mid=(b+e)/2;
    buildSegmentTree(b,mid,node*2);
    buildSegmentTree(mid+1,e,1+(node*2));
    maxvals[node]=max(maxvals[2*node],maxvals[1+(node*2)]);
    //minvals[node]=min(minvals[2*node],minvals[(1+(2*node))]);
}
ll getMaxelement(ll b, ll e, ll node, ll qb, ll qe){
    if(b>qe||e<qb)
        return 0;
    if(b>=qb&&e<=qe)
        return maxvals[node];
    ll m=(b+e)/2;
    ll f=getMaxelement(b,m,node*2,qb,qe),s=getMaxelement(m+1,e,1+(node*2),qb,qe);
    return max(f,s);
}
ll getMinelement(ll b, ll e, ll node, ll qb, ll qe){
    if(b>qe||e<qb)
        return 10000000000000;
    if(b>=qb&&e<=qe)
        return minvals[node];
    ll m=(b+e)/2;
    ll f=getMinelement(b,m,node*2,qb,qe),s=getMinelement(m+1,e,1+(node*2),qb,qe);
    return min(f,s);
}
ll le,ri;

double angle[1];
vector<ll>nvals;
vector<ll>mvals;
ll n,p;
string s;
bool isValidChar(long pos,char ch){
    if(pos==0)
        return true;
    if(pos==1){
        if(s[0]!=ch)
            return true;
        return false;
    }
    if(s[pos-1]!=ch&&s[pos-2]!=ch)
        return true;
    return false;
}
char nextChar(long pos){
    char lim='a'+p,sChar=s[pos];
    sChar++;
    for(char ch=s[pos]+1;ch<('a'+p);ch++){
        if(isValidChar(pos,ch))
            return ch;
    }
    return s[pos];
}
void buildNext(long startPos){
    for(long i=startPos;i<n;i++){
        if(s[i-1]!='a'&&(i==1||s[i-2]!='a'))
            s[i]='a';
        else if((i==1||s[i-2]!='b')&&s[i-1]!='b')
            s[i]='b';
        else
            s[i]='c';
    }
}
int main(void){
//  freopen ("E:/inputSmall.txt","r",stdin);
 //   freopen ("E:/outputSmall2.txt","w",stdout);
    ll test_cases=1;//,C,D,A,L,R,rep,round=0,rem,num;
 //   memset(posOf,-1,sizeof(posOf));
  //double st,en,minerr=0.00000001,r,v;
  //cin>>test_cases>>r>>v;
    cout << setprecision(15) << fixed;
 // buildpwr2(20);
 memset(maxvals,0,sizeof(maxvals));
    ll k,extra,ans=0,cowbells[100005],curSize;

    cin>>n>>p;
    cin>>s;
    bool posible=false;
    if(p==1){
        cout<<"NO"<<endl;
        return 0;
    }
    if(p==2){
        if(s[0]=='b')
            cout<<"NO"<<endl;
        else if(n==2)
            cout<<"ba"<<endl;
        else
            cout<<"b"<<endl;
        return 0;
    }

    for(long i=n-1;i>-1;i--){
        char ch=nextChar(i);
        if(ch!=s[i]){
            s[i]=ch;
            buildNext(i+1);
            cout<<s<<endl;
            return 0;
        }
    }
    cout<<"NO"<<endl;
    return 0;
}
/*ll cumDist1[100005];
ll cumDist2[100005];
vector<ll>distFrom1;
vector<ll>distFrom2;
void initFact(){
    fact[0]=1;
    factInv[0]=1;
    for(ll i=1;i<0;i++){
        factInv[i]=(factInv[i-1]*getmoduloInv(i))%mdlo;
        fact[i]=(fact[i-1]*i)%mdlo;
    }
}
bool isLeapyear(long year){
    if(year%4==0&&(year%100!=0||year%400==0))
        return true;
    return false;
}
ll ds,ms,ys,de,me,ye,dc,mc,yc,day;
void next13th(){
    if(ds<13){
        ds=13;
        return;
    }
    ms++;
    ds=13;
    if(ms>12)
    {
        ms=1;
        ys++;
    }
}
    long months[]={31,28,31,30,31,30,31,31,30,31,30,31};
    long dayBeforeMonth[12];
bool validDate(){
    if(ys>ye)
        return false;
    if(ys<ye)
        return true;
    if(ms>me)
        return false;
    if(ms<me)
        return true;
    if(ds>de)
        return false;
    return true;
}
long getDay(long d,long m,long y){
    long day=((y-1900)*365+(y-1900)/4-(y-1900)/100+(y-1600)/400+dayBeforeMonth[m-1]+d+2)%7;
    if(y%4==0&&m<3){
        if(y%400==0||y%100!=0)
            day=(day+6)%7;
    }
    return day;
}
bool iscurDayFriday(){
    if(getDay(ds,ms,ys)==0)
        return true;
    return false;
}
void dijkstra(long startPoint){
    long m;
    if(startPoint==1)
        m=0;
    else
        m=1;
    distMatrix[m][startPoint]=0;
    priority_queue<edge, vector<edge>,greater <edge>>pq;
    pq.push(edge(0,startPoint));
    while(!pq.empty()){
        edge top=pq.top();
        pq.pop();
        ll d= top.first,u=top.second;
        if(distMatrix[m][u]==d){
            for(long i=0;i<graph[u].size();i++){
                ll v=graph[u][i].second;
                ll ec=graph[u][i].first;
                if(distMatrix[m][v]>distMatrix[m][u]+ec){
                    distMatrix[m][v]=distMatrix[m][u]+ec;
                    pq.push(edge(distMatrix[m][v],v));
                }
            }
        }
    }
}
ll vals[1];
ll dp[1];
ll totalSum[1];
long long mInv[1];
long long fact[1];
long long factInv[1];

//long long pow10[18];
long long getmoduloInv(long long n){
    if(n==1)
        return 1;
    if(mInv[n]>0)
        return mInv[n];
    long long m=(-1*mdlo)/n;
    m+=mdlo;
    m*=getmoduloInv(mdlo%n);
    mInv[n]=(m%mdlo);
    return mInv[n];
}
long long onNthbit(long pos,long val){
    return val|pwr2[pos];
}
bool isNthbitOn(long long pos,long long val){
    return (val&pwr2[pos])>0;
}

seg segTree[5];
long N;
void buildSumSegmentTree(long long b,long long e,long long node){
    if(b==e)
    {
         segTree[node].first=vals[b];
         return;
    }
    long long mid=(b+e)/2;
    buildSumSegmentTree(b,mid,node*2);
    buildSumSegmentTree(mid+1,e,1+(node*2));
    segTree[node].first=segTree[2*node].first+segTree[1+(node*2)].first;
}
long long getSum(long long qStart,long long qEnd,long long sStart,long long sEnd,long long node,prop p){

    long k=sEnd-sStart,n;
    for(long i=0;i<p.size();i++){
        segTree[node].second.push_back(p[i]);
        n=p[i];
        segTree[node].first+=(((n+k)*(n+k+1)*(2*n+2*k+1)-(n*(n-1)*(2*n-1)))/6+((n+k)*(n+k+1)-n*(n-1)))/2;
        }
    if(qEnd<sStart||qStart>sEnd)
    {
        return 0;
    }
    if(sStart>=qStart&&sEnd<=qEnd)
    {
         return segTree[node].first;
    }
    long long sMid=(sStart+sEnd)/2;
    prop l;
    for(long i=0;segTree[node].second.size();i++)
        l.push_back(segTree[node].second[i]+sMid+1-sStart);
    return getSum(qStart,qEnd,sStart,sMid,2*node,segTree[node].second)+getSum(qStart,qEnd,sMid+1,sEnd,1+(2*node),l);
}
long long update(ll node, long long sStart,ll sEnd,long upStart,long upEnd){
    if(upEnd<sStart||upStart>sEnd)
        return 0;
    long k=sEnd-sStart,n=sStart+1-upStart;
    if(upStart<=sStart&&upEnd>=sEnd){
        segTree[node].second.push_back(n);
        segTree[node].first+=(((n+k)*(n+k+1)*(2*n+2*k+1))/6);
        segTree[node].first-=(((n*(n-1)*(2*n-1)))/6);
        segTree[node].first+=(((n+k)*(n+k+1)-n*(n-1)))/2;
        return 0;
    }
    ll sMid=(sStart+sEnd)/2;
    update(node*2,sStart,sMid,upStart,upEnd);
    update(1+(node*2),sMid+1,sEnd,upStart,upEnd);
    segTree[node].first=segTree[2*node].first+segTree[1+(node*2)].first;

    for(long i=0;i<segTree[node].second.size();i++){
        n=segTree[node].second[i];
        segTree[node].first+=(((n+k)*(n+k+1)*(2*n+2*k+1)-(n*(n-1)*(2*n-1)))/6+((n+k)*(n+k+1)-n*(n-1)))/2;
    }
    return segTree[node].first;
}
void update(long x,long y){
    long len=y-x+1,add=0;
    for(long i=0;i<len;i++){
        add+=(i+1)*2;
        update(1,0,N-1,x+i,add+vals[x+i]);
    }
}
long getlen(long long num){
    long len=0;
    while(num>0){
        num/=10;
        len++;
    }
    return len;
}
encryptedLine lineConverter(string s){
    encryptedLine el;
    ll val=0,len=s.size();
    for(long i=0;i<len;i++){
        if(s[i]==' '){
            el.push_back(val);
            val=0;
        }
        else{
            val*=26;
            val+=(s[i]-'a');
        }
    }
    el.push_back(val);
    return el;
}
long getPalinDrome(long num){
    long a=num%10;
    long b=(num/10)%10;
    long c=(num/100)%10;
    return num*1000+a*100+b*10+c;
}

vector<unsigned long> get_primes(unsigned long max){
    vector<unsigned long> primes;
    char *sieve;
    sieve = new char[max/8+1];
    // Fill sieve with 1
    long m=(max/8)+1;
    for(long long i=0;i<m;i++)
        sieve[i]=255;
    for(unsigned long x = 2; x <= max; x++)
        if(sieve[x/8] & (0x01 << (x % 8))){
            primes.push_back(x);
            // Is prime. Mark multiplicates.
            for(unsigned long j = 2*x; j <= max; j += x)
                sieve[j/8] &= ~(0x01 << (j % 8));
        }
    delete[] sieve;
    return primes;
}string add(string a,string b){
    int l1=a.size();
    int l2=b.size();
    while(l1<l2){
        a="0"+a;
        l1++;
    }
    while(l2<l1){
        b="0"+b;
        l2++;
    }
    string s;
    int carry=0;
    for(long i=l2-1;i>-1;i--){
        int d=a[i]+b[i]+carry-2*'0';
        carry=d/10;
        a[i]='0'+(d%10);
    }
    if(carry)
        a="1"+a;
    return a;
}
long long mInv[1010];
long long fact[1000];
long long factInv[1000];
long long getmoduloInv(long long n){
    if(n==1)
        return 1;
    if(mInv[n]>0)
        return mInv[n];
    long long m=(-1*mdlo)/n;
    m+=mdlo;
    m*=getmoduloInv(mdlo%n);
    mInv[n]=(m%mdlo);
    return mInv[n];

}

long dp[200010];
vector<weightedPos>points;
vector<weightedPos>modifiedPositions;
vector<long long>weightPlusPos;
long long segTree[530010];
long N,X,W;
void buildSegTree(long node,long b,long e){
    if(b==e)
        segTree[node]=b;
    else{
        long mid=(b+e)/2;
        buildSegTree(node*2,b,mid);
        buildSegTree(1+node*2,mid+1,e);
        if(weightPlusPos[segTree[node*2]]<=weightPlusPos[segTree[1+node*2]])
            segTree[node]=segTree[node*2];
        else
            segTree[node]=segTree[1+node*2];
    }
}
long long getMin(long node,long segBeg,long segEnd,long qBeg,long qEnd){
    if(segEnd<qBeg||segBeg>qEnd)
        return N;
    if(segBeg>=qBeg&&segEnd<=qEnd)
        return segTree[node];
    long mid=(segBeg+segEnd)/2;
    long fh=getMin(node*2,segBeg,mid,qBeg,qEnd);
    long sh=getMin(1+node*2,mid+1,segEnd,qBeg,qEnd);
    if(weightPlusPos[sh]<weightPlusPos[fh])
        return sh;
    return fh;
}
long long getMinPos(long node,long segBeg,long segEnd,long qBeg,long qEnd){
    if(segEnd<qBeg||segBeg<qEnd)
        return 0;
    if(segBeg>=qBeg&&segEnd<=qEnd)
        return segTree[node];
    long mid=(segBeg+segEnd)/2;
    long fh=getMin(node*2,segBeg,mid,qBeg,qEnd);
    long sh=getMin(node*2,mid+1,segEnd,qBeg,qEnd);
    return min(fh,sh);
}
long getPos(long val){
    long low=0,high=modifiedPositions.size()-1;
    long mid=(low+high)/2;
    while(low<high){
        if(modifiedPositions[mid].first<val)
            low=mid+1;
        else
            high=mid-1;
        mid=(low+high)/2;
    }
    if(mid>0)
        mid--;
    while(mid<modifiedPositions.size()&&modifiedPositions[mid].first<val)
        mid++;
    return mid;
}
long getMaxGroup(long index){
    if(dp[index]>-1)
        return dp[index];
    long pos=getPos(points[index].first+points[index].second);
    if(pos>=N)
        return 1;
    long nextPoint=getMin(1,0,N-1,pos,N-1);
    dp[index]=1+getMaxGroup(nextPoint);
    return dp[index];
}
*/


#include<stdio.h>
#include<iostream>
#include<string>
#include<cstring>
#include <iomanip>
#include<stack>
#include<set>
#include<vector>
#include<algorithm>
#include<set>
#include<bitset>
#include<map>
#include<queue>
#include<math.h>
using namespace std;
#define mdlo 1000000007
#define maxERR 0.00000064
//#define minVal -10000000000000
#define maxBits 40
#define pi 3.1415926535897932384626433832795
#define INF 999999999999
typedef long long ll;
long long mInv[41];
long long fact[41];
long long factInv[41],M;
typedef pair<long,long>edge;
typedef vector<long>adjList;
long levels[15];
long nextPoint[15];
long firstDigit[15];
bool inTree[1];
bool visited[1];
struct treeInfo{
    long depth;
    long longestPath;
    long startPointOflongestpath;
    long deepestNode;
    bool included;
};
adjList tree[16];
adjList rails[410];
adjList buses[410];
vector<long>startPoints;
//long finalCount[1000106];
adjList graph[15];
long long getmoduloInv(long long n){
    if(n==1)
        return 1;
    if(mInv[n]>0)
        return mInv[n];
    long long m=(-1*mdlo)/n;
    m+=mdlo;
    m*=getmoduloInv(mdlo%n);
    mInv[n]=(m%mdlo);
    return mInv[n];
}
ll par[45];
ll getAncestor(ll val){
    if(par[val]!=val)
        par[val]=getAncestor(par[val]);
    return par[val];
}
bool unify(ll a,ll b){
    ll para=getAncestor(a),parb=getAncestor(b);
    if(para==parb)
        return false;
    if(para<parb)
        par[parb]=para;
    else
        par[para]=parb;
    return true;
}
vector<unsigned long> primes;
vector<unsigned long> get_primes(unsigned long max){

    char *sieve;
    sieve = new char[max/8+1];
    // Fill sieve with 1
    long m=(max/8)+1;
    for(long long i=0;i<m;i++)
        sieve[i]=255;
    for(unsigned long x = 2; x <= max; x++)
        if(sieve[x/8] & (0x01 << (x % 8))){
            primes.push_back(x);
            // Is prime. Mark multiplicates.
            for(unsigned long j = 2*x; j <= max; j += x)
                sieve[j/8] &= ~(0x01 << (j % 8));
        }
    delete[] sieve;
    return primes;
}
double dp[2][2];
long nextRight[2012];
long nextLeft[2012];
ll treepos[20];
ll H,N;
ll h[2],maxvals[6],minvals[2],curMax=-1,curMin=11111111111;
ll lPoint[2],rPoint[2];
long railMatrix[410][410];
bool isPrime(long N){
    if(N==1)
    return false;
    if(N<4)
        return true;
    for(long i=2;i*i<N;i++){
        if(N%i==0)
            return false;
    }
    return true;
}
ll gcd(ll a,ll b){
    ll c;
    if(a>b){
        c=a;
        a=b;
        b=c;
    }
    if(a==0)
        return b;
    c=b%a;
    while(c>0){
        b=a;
        a=c;
        c=b%a;
    }
    return a;
}
long long getLcm(long long a,long long b){
    long long c=a/gcd(a,b);
    return b*c;
}
void buildSegmentTree(long long b,long long e,long long node){
    if(b==e)
    {
        maxvals[node]=h[b];
        minvals[node]=h[b];
         return;
    }
    long long mid=(b+e)/2;
    buildSegmentTree(b,mid,node*2);
    buildSegmentTree(mid+1,e,1+(node*2));
    maxvals[node]=max(maxvals[2*node],maxvals[1+(node*2)]);
    //minvals[node]=min(minvals[2*node],minvals[(1+(2*node))]);
}
ll getMaxelement(ll b, ll e, ll node, ll qb, ll qe){
    if(b>qe||e<qb)
        return 0;
    if(b>=qb&&e<=qe)
        return maxvals[node];
    ll m=(b+e)/2;
    ll f=getMaxelement(b,m,node*2,qb,qe),s=getMaxelement(m+1,e,1+(node*2),qb,qe);
    return max(f,s);
}
ll getMinelement(ll b, ll e, ll node, ll qb, ll qe){
    if(b>qe||e<qb)
        return 10000000000000;
    if(b>=qb&&e<=qe)
        return minvals[node];
    ll m=(b+e)/2;
    ll f=getMinelement(b,m,node*2,qb,qe),s=getMinelement(m+1,e,1+(node*2),qb,qe);
    return min(f,s);
}
ll le,ri;

double angle[1];
vector<ll>nvals;
vector<ll>mvals;
ll n,p;
string s;
bool isValidChar(long pos,char ch){
    if(pos==0)
        return true;
    if(pos==1){
        if(s[0]!=ch)
            return true;
        return false;
    }
    if(s[pos-1]!=ch&&s[pos-2]!=ch)
        return true;
    return false;
}
char nextChar(long pos){
    char lim='a'+p,sChar=s[pos];
    sChar++;
    for(char ch=s[pos]+1;ch<('a'+p);ch++){
        if(isValidChar(pos,ch))
            return ch;
    }
    return s[pos];
}
void buildNext(long startPos){
    if(startPos!=n)
        s[startPos]='a';
    for(long i=startPos+1;i<n;i++){
        if(s[i-1]!='a'&&s[i-2]!='a')
            s[i]='a';
        else if(s[i-2]!='b'&&s[i-2]!='b')
            s[i]='b';
        else
            s[i]='c';
    }
}
int main(void){
//  freopen ("E:/inputSmall.txt","r",stdin);
 //   freopen ("E:/outputSmall2.txt","w",stdout);
    ll test_cases=1;//,C,D,A,L,R,rep,round=0,rem,num;
 //   memset(posOf,-1,sizeof(posOf));
  //double st,en,minerr=0.00000001,r,v;
  //cin>>test_cases>>r>>v;
    cout << setprecision(15) << fixed;
 // buildpwr2(20);
 memset(maxvals,0,sizeof(maxvals));
    ll k,extra,ans=0,cowbells[100005],curSize;

    cin>>n>>p;
    cin>>s;
    bool posible=false;
    if(p==1){
        cout<<"NO"<<endl;
        return 0;
    }
    if(p==2){
        if(s[0]=='b')
            cout<<"NO"<<endl;
        else
            cout<<"ba"<<endl;
        return 0;
    }

    for(long i=n-1;i>-1;i--){
        char ch=nextChar(i);
        if(ch!=s[i]){
            s[i]=ch;
            buildNext(i+1);
            cout<<s<<endl;
            return 0;
        }
    }
    cout<<"NO"<<endl;
    return 0;
}
/*ll cumDist1[100005];
ll cumDist2[100005];
vector<ll>distFrom1;
vector<ll>distFrom2;
void initFact(){
    fact[0]=1;
    factInv[0]=1;
    for(ll i=1;i<0;i++){
        factInv[i]=(factInv[i-1]*getmoduloInv(i))%mdlo;
        fact[i]=(fact[i-1]*i)%mdlo;
    }
}
bool isLeapyear(long year){
    if(year%4==0&&(year%100!=0||year%400==0))
        return true;
    return false;
}
ll ds,ms,ys,de,me,ye,dc,mc,yc,day;
void next13th(){
    if(ds<13){
        ds=13;
        return;
    }
    ms++;
    ds=13;
    if(ms>12)
    {
        ms=1;
        ys++;
    }
}
    long months[]={31,28,31,30,31,30,31,31,30,31,30,31};
    long dayBeforeMonth[12];
bool validDate(){
    if(ys>ye)
        return false;
    if(ys<ye)
        return true;
    if(ms>me)
        return false;
    if(ms<me)
        return true;
    if(ds>de)
        return false;
    return true;
}
long getDay(long d,long m,long y){
    long day=((y-1900)*365+(y-1900)/4-(y-1900)/100+(y-1600)/400+dayBeforeMonth[m-1]+d+2)%7;
    if(y%4==0&&m<3){
        if(y%400==0||y%100!=0)
            day=(day+6)%7;
    }
    return day;
}
bool iscurDayFriday(){
    if(getDay(ds,ms,ys)==0)
        return true;
    return false;
}
void dijkstra(long startPoint){
    long m;
    if(startPoint==1)
        m=0;
    else
        m=1;
    distMatrix[m][startPoint]=0;
    priority_queue<edge, vector<edge>,greater <edge>>pq;
    pq.push(edge(0,startPoint));
    while(!pq.empty()){
        edge top=pq.top();
        pq.pop();
        ll d= top.first,u=top.second;
        if(distMatrix[m][u]==d){
            for(long i=0;i<graph[u].size();i++){
                ll v=graph[u][i].second;
                ll ec=graph[u][i].first;
                if(distMatrix[m][v]>distMatrix[m][u]+ec){
                    distMatrix[m][v]=distMatrix[m][u]+ec;
                    pq.push(edge(distMatrix[m][v],v));
                }
            }
        }
    }
}
ll vals[1];
ll dp[1];
ll totalSum[1];
long long mInv[1];
long long fact[1];
long long factInv[1];

//long long pow10[18];
long long getmoduloInv(long long n){
    if(n==1)
        return 1;
    if(mInv[n]>0)
        return mInv[n];
    long long m=(-1*mdlo)/n;
    m+=mdlo;
    m*=getmoduloInv(mdlo%n);
    mInv[n]=(m%mdlo);
    return mInv[n];
}
long long onNthbit(long pos,long val){
    return val|pwr2[pos];
}
bool isNthbitOn(long long pos,long long val){
    return (val&pwr2[pos])>0;
}

seg segTree[5];
long N;
void buildSumSegmentTree(long long b,long long e,long long node){
    if(b==e)
    {
         segTree[node].first=vals[b];
         return;
    }
    long long mid=(b+e)/2;
    buildSumSegmentTree(b,mid,node*2);
    buildSumSegmentTree(mid+1,e,1+(node*2));
    segTree[node].first=segTree[2*node].first+segTree[1+(node*2)].first;
}
long long getSum(long long qStart,long long qEnd,long long sStart,long long sEnd,long long node,prop p){

    long k=sEnd-sStart,n;
    for(long i=0;i<p.size();i++){
        segTree[node].second.push_back(p[i]);
        n=p[i];
        segTree[node].first+=(((n+k)*(n+k+1)*(2*n+2*k+1)-(n*(n-1)*(2*n-1)))/6+((n+k)*(n+k+1)-n*(n-1)))/2;
        }
    if(qEnd<sStart||qStart>sEnd)
    {
        return 0;
    }
    if(sStart>=qStart&&sEnd<=qEnd)
    {
         return segTree[node].first;
    }
    long long sMid=(sStart+sEnd)/2;
    prop l;
    for(long i=0;segTree[node].second.size();i++)
        l.push_back(segTree[node].second[i]+sMid+1-sStart);
    return getSum(qStart,qEnd,sStart,sMid,2*node,segTree[node].second)+getSum(qStart,qEnd,sMid+1,sEnd,1+(2*node),l);
}
long long update(ll node, long long sStart,ll sEnd,long upStart,long upEnd){
    if(upEnd<sStart||upStart>sEnd)
        return 0;
    long k=sEnd-sStart,n=sStart+1-upStart;
    if(upStart<=sStart&&upEnd>=sEnd){
        segTree[node].second.push_back(n);
        segTree[node].first+=(((n+k)*(n+k+1)*(2*n+2*k+1))/6);
        segTree[node].first-=(((n*(n-1)*(2*n-1)))/6);
        segTree[node].first+=(((n+k)*(n+k+1)-n*(n-1)))/2;
        return 0;
    }
    ll sMid=(sStart+sEnd)/2;
    update(node*2,sStart,sMid,upStart,upEnd);
    update(1+(node*2),sMid+1,sEnd,upStart,upEnd);
    segTree[node].first=segTree[2*node].first+segTree[1+(node*2)].first;

    for(long i=0;i<segTree[node].second.size();i++){
        n=segTree[node].second[i];
        segTree[node].first+=(((n+k)*(n+k+1)*(2*n+2*k+1)-(n*(n-1)*(2*n-1)))/6+((n+k)*(n+k+1)-n*(n-1)))/2;
    }
    return segTree[node].first;
}
void update(long x,long y){
    long len=y-x+1,add=0;
    for(long i=0;i<len;i++){
        add+=(i+1)*2;
        update(1,0,N-1,x+i,add+vals[x+i]);
    }
}
long getlen(long long num){
    long len=0;
    while(num>0){
        num/=10;
        len++;
    }
    return len;
}
encryptedLine lineConverter(string s){
    encryptedLine el;
    ll val=0,len=s.size();
    for(long i=0;i<len;i++){
        if(s[i]==' '){
            el.push_back(val);
            val=0;
        }
        else{
            val*=26;
            val+=(s[i]-'a');
        }
    }
    el.push_back(val);
    return el;
}
long getPalinDrome(long num){
    long a=num%10;
    long b=(num/10)%10;
    long c=(num/100)%10;
    return num*1000+a*100+b*10+c;
}

vector<unsigned long> get_primes(unsigned long max){
    vector<unsigned long> primes;
    char *sieve;
    sieve = new char[max/8+1];
    // Fill sieve with 1
    long m=(max/8)+1;
    for(long long i=0;i<m;i++)
        sieve[i]=255;
    for(unsigned long x = 2; x <= max; x++)
        if(sieve[x/8] & (0x01 << (x % 8))){
            primes.push_back(x);
            // Is prime. Mark multiplicates.
            for(unsigned long j = 2*x; j <= max; j += x)
                sieve[j/8] &= ~(0x01 << (j % 8));
        }
    delete[] sieve;
    return primes;
}string add(string a,string b){
    int l1=a.size();
    int l2=b.size();
    while(l1<l2){
        a="0"+a;
        l1++;
    }
    while(l2<l1){
        b="0"+b;
        l2++;
    }
    string s;
    int carry=0;
    for(long i=l2-1;i>-1;i--){
        int d=a[i]+b[i]+carry-2*'0';
        carry=d/10;
        a[i]='0'+(d%10);
    }
    if(carry)
        a="1"+a;
    return a;
}
long long mInv[1010];
long long fact[1000];
long long factInv[1000];
long long getmoduloInv(long long n){
    if(n==1)
        return 1;
    if(mInv[n]>0)
        return mInv[n];
    long long m=(-1*mdlo)/n;
    m+=mdlo;
    m*=getmoduloInv(mdlo%n);
    mInv[n]=(m%mdlo);
    return mInv[n];

}

long dp[200010];
vector<weightedPos>points;
vector<weightedPos>modifiedPositions;
vector<long long>weightPlusPos;
long long segTree[530010];
long N,X,W;
void buildSegTree(long node,long b,long e){
    if(b==e)
        segTree[node]=b;
    else{
        long mid=(b+e)/2;
        buildSegTree(node*2,b,mid);
        buildSegTree(1+node*2,mid+1,e);
        if(weightPlusPos[segTree[node*2]]<=weightPlusPos[segTree[1+node*2]])
            segTree[node]=segTree[node*2];
        else
            segTree[node]=segTree[1+node*2];
    }
}
long long getMin(long node,long segBeg,long segEnd,long qBeg,long qEnd){
    if(segEnd<qBeg||segBeg>qEnd)
        return N;
    if(segBeg>=qBeg&&segEnd<=qEnd)
        return segTree[node];
    long mid=(segBeg+segEnd)/2;
    long fh=getMin(node*2,segBeg,mid,qBeg,qEnd);
    long sh=getMin(1+node*2,mid+1,segEnd,qBeg,qEnd);
    if(weightPlusPos[sh]<weightPlusPos[fh])
        return sh;
    return fh;
}
long long getMinPos(long node,long segBeg,long segEnd,long qBeg,long qEnd){
    if(segEnd<qBeg||segBeg<qEnd)
        return 0;
    if(segBeg>=qBeg&&segEnd<=qEnd)
        return segTree[node];
    long mid=(segBeg+segEnd)/2;
    long fh=getMin(node*2,segBeg,mid,qBeg,qEnd);
    long sh=getMin(node*2,mid+1,segEnd,qBeg,qEnd);
    return min(fh,sh);
}
long getPos(long val){
    long low=0,high=modifiedPositions.size()-1;
    long mid=(low+high)/2;
    while(low<high){
        if(modifiedPositions[mid].first<val)
            low=mid+1;
        else
            high=mid-1;
        mid=(low+high)/2;
    }
    if(mid>0)
        mid--;
    while(mid<modifiedPositions.size()&&modifiedPositions[mid].first<val)
        mid++;
    return mid;
}
long getMaxGroup(long index){
    if(dp[index]>-1)
        return dp[index];
    long pos=getPos(points[index].first+points[index].second);
    if(pos>=N)
        return 1;
    long nextPoint=getMin(1,0,N-1,pos,N-1);
    dp[index]=1+getMaxGroup(nextPoint);
    return dp[index];
}
*/


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iostream>
#include <functional>
#include <time.h>
#include <cmath>
#include <deque>

using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define ld long double
#pragma comment(linker, "/STACK:36777216")

ll EPS = 1000000007;
double PI = 3.14159265358979323846;
const int MAXN = 1000010;

__int64 abss(__int64 h)
{
	if (h < 0)
	{
		return -h;
	}
	return h;
}

ld fabss(ld h)
{
	if (h < 0.0)
	{
		return -h;
	}
	return h;
}

__int64 ceill(__int64 x, __int64 y)
{
	if (x % y != 0)
	{
		return (x / y) + 1;
	}
	return x / y;
}

int n, m, k;

int a[MAXN];
int b[MAXN];
//int a[1010][1010];

string alp = "1";

int main()
{
    //freopen("strings.in", "r", stdin);
	//freopen("strings.out", "w", stdout);
	ios_base::sync_with_stdio(0);
	int p;
	cin >> n >> p;
	b['1' - 'a'] = 0;
	int y = 1;
	for (char i = 'a'; i <= 'z'; i++)
	{
		alp += i;
		b[i - 'a'] = y;
	}
	//if (n == 1 && p == 1)
	//{
	//	cout << "NO";
	//	return 0;
	//}
	string str;
	cin >> str;
	//if (n == 1 && p > 1)
	//{
	//	if (str[0] == alp[p])
	//	{
	//		cout << "NO";
	//		return 0;
	//	}
	//}
	int len = str.size();
	for (int i = len - 1; i >= 0; i--)
	{
		int index = 0;
		for (int j = 1; i <= p; j++)
		{
			if (str[i] == alp[j])
			{
				index = j;
				break;
			}
		}
		for (int j = index + 1; j <= p; j++)
		{
			str[i] = alp[j];
			int c = 0;
			for (int q = 1; q <= 2; q++)
			{
				if (i - q >= 0)
				{
					if (str[i] != str[i - q])
					{
						c++;
					}
					continue;
				}
				c++;
			}
			if (c == 2)
			{
				char t = 'a';
				int u = 0;
				string str2 = str;
				for (int z = i + 1; z < len; z++)
				{
					int d = 0;
					if (t > alp[p])
					{
						u = 1;
						break;
					}
					for (int q = 1; q <= 2; q++)
					{
						if (z - q >= 0)
						{
							if (t != str[z - q])
							{
								d++;
							}
							continue;
						}
						d++;
					}
					if (d != 2)
					{
						t++;
						z--;
						continue;
					}
					str[z] = t;
					t = 'a';
				}
				if (u == 1)
				{
					continue;
				}
				cout << str;
				return 0;
			}
		}
	}
	cout << "NO";
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iostream>
#include <functional>
#include <time.h>
#include <cmath>
#include <deque>

using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define ld long double
#pragma comment(linker, "/STACK:36777216")

ll EPS = 1000000007;
double PI = 3.14159265358979323846;
const int MAXN = 1000010;

__int64 abss(__int64 h)
{
	if (h < 0)
	{
		return -h;
	}
	return h;
}

ld fabss(ld h)
{
	if (h < 0.0)
	{
		return -h;
	}
	return h;
}

__int64 ceill(__int64 x, __int64 y)
{
	if (x % y != 0)
	{
		return (x / y) + 1;
	}
	return x / y;
}

int n, m, k;

int a[MAXN];
int b[MAXN];
//int a[1010][1010];

string alp = "1";

int main()
{
    //freopen("strings.in", "r", stdin);
	//freopen("strings.out", "w", stdout);
	ios_base::sync_with_stdio(0);
	int p;
	cin >> n >> p;
	b['1' - 'a'] = 0;
	int y = 1;
	for (char i = 'a'; i <= 'z'; i++)
	{
		alp += i;
		b[i - 'a'] = y;
	}
	//if (n == 1 && p == 1)
	//{
	//	cout << "NO";
	//	return 0;
	//}
	string str;
	cin >> str;
	//if (n == 1 && p > 1)
	//{
	//	if (str[0] == alp[p])
	//	{
	//		cout << "NO";
	//		return 0;
	//	}
	//}
	int len = str.size();
	for (int i = len - 1; i >= 0; i--)
	{
		int index = 0;
		for (int j = 1; i <= p; j++)
		{
			if (str[i] == alp[j])
			{
				index = j;
				break;
			}
		}
		for (int j = index + 1; j <= p; j++)
		{
			str[i] = alp[j];
			int c = 0;
			for (int q = 1; q <= 2; q++)
			{
				if (i - q >= 0)
				{
					if (str[i] != str[i - q])
					{
						c++;
					}
					continue;
				}
				c++;
			}
			if (c == 2)
			{
				char t = 'a';
				int u = 0;
				string str2 = str;
				for (int z = i + 1; z < len; z++)
				{
					int d = 0;
					for (int q = 1; q <= 2; q++)
					{
						if (z - q >= 0)
						{
							if (t != str[z - q])
							{
								d++;
							}
							continue;
						}
						d++;
					}
					if (d != 2)
					{
						t++;
						z--;
						continue;
					}
					if (t > alp[p])
					{
						u = 1;
						str = str2;
						break;
					}
					str[z] = t;
					t = 'a';
				}
				if (u == 1)
				{
					continue;
				}
				cout << str;
				return 0;
			}
		}
	}
	cout << "NO";
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iostream>
#include <functional>
#include <time.h>
#include <cmath>
#include <deque>

using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define ld long double
#pragma comment(linker, "/STACK:36777216")

ll EPS = 1000000007;
double PI = 3.14159265358979323846;
const int MAXN = 1000010;

__int64 abss(__int64 h)
{
	if (h < 0)
	{
		return -h;
	}
	return h;
}

ld fabss(ld h)
{
	if (h < 0.0)
	{
		return -h;
	}
	return h;
}

__int64 ceill(__int64 x, __int64 y)
{
	if (x % y != 0)
	{
		return (x / y) + 1;
	}
	return x / y;
}

int n, m, k;

int a[MAXN];
int b[MAXN];
//int a[1010][1010];

string alp = "1";

int main()
{
    //freopen("strings.in", "r", stdin);
	//freopen("strings.out", "w", stdout);
	ios_base::sync_with_stdio(0);
	int p;
	cin >> n >> p;
	b['1' - 'a'] = 0;
	int y = 1;
	for (char i = 'a'; i <= 'z'; i++)
	{
		alp += i;
		b[i - 'a'] = y;
	}
	//if (n == 1 && p == 1)
	//{
	//	cout << "NO";
	//	return 0;
	//}
	string str;
	cin >> str;
	//if (n == 1 && p > 1)
	//{
	//	if (str[0] == alp[p])
	//	{
	//		cout << "NO";
	//		return 0;
	//	}
	//}
	int len = str.size();
	for (int i = len - 1; i >= 0; i--)
	{
		int index = 0;
		for (int j = 1; i <= p; j++)
		{
			if (str[i] == alp[j])
			{
				index = j;
				break;
			}
		}
		for (int j = index + 1; j <= p; j++)
		{
			str[i] = alp[j];
			int c = 0;
			for (int q = 1; q <= 2; q++)
			{
				if (i - q >= 0)
				{
					if (str[i] != str[i - q])
					{
						c++;
					}
					continue;
				}
				c++;
			}
			if (c == 2)
			{
				char t = 'a';
				for (int z = i + 1; z < len; z++)
				{
					str[z] = t;
					t++;
					if (t == 'd')
					{
						t = 'a';
					}
				}
				cout << str;
				return 0;
			}
		}
	}
	cout << "NO";
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iostream>
#include <functional>
#include <time.h>
#include <cmath>
#include <deque>

using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define ld long double
#pragma comment(linker, "/STACK:36777216")

ll EPS = 1000000007;
double PI = 3.14159265358979323846;
const int MAXN = 1000010;

__int64 abss(__int64 h)
{
	if (h < 0)
	{
		return -h;
	}
	return h;
}

ld fabss(ld h)
{
	if (h < 0.0)
	{
		return -h;
	}
	return h;
}

__int64 ceill(__int64 x, __int64 y)
{
	if (x % y != 0)
	{
		return (x / y) + 1;
	}
	return x / y;
}

int n, m, k;

int a[MAXN];
int b[MAXN];
//int a[1010][1010];

string alp = "1";

int main()
{
    //freopen("strings.in", "r", stdin);
	//freopen("strings.out", "w", stdout);
	ios_base::sync_with_stdio(0);
	int p;
	cin >> n >> p;
	b['1' - 'a'] = 0;
	int y = 1;
	for (char i = 'a'; i <= 'z'; i++)
	{
		alp += i;
		b[i - 'a'] = y;
	}
	//if (n == 1 && p == 1)
	//{
	//	cout << "NO";
	//	return 0;
	//}
	string str;
	cin >> str;
	//if (n == 1 && p > 1)
	//{
	//	if (str[0] == alp[p])
	//	{
	//		cout << "NO";
	//		return 0;
	//	}
	//}
	int len = str.size();
	for (int i = len - 1; i >= 0; i--)
	{
		int index = 0;
		for (int j = 1; j <= p; j++)
		{
			if (str[i] == alp[j])
			{
				index = j;
				break;
			}
		}
		for (int j = index + 1; j <= p; j++)
		{
			str[i] = alp[j];
			int c = 0;
			for (int q = 1; q <= 2; q++)
			{
				if (i - q >= 0)
				{
					if (str[i] != str[i - q])
					{
						c++;
					}
					continue;
				}
				c++;
			}
			if (c == 2)
			{
				char t = 'a';
				int u = 0;
				//string str2 = str;
				for (int z = i + 1; z < len; z++)
				{
					int d = 0;
					if (t > alp[p])
					{
						u = 1;
						break;
					}
					for (int q = 1; q <= 2; q++)
					{
						if (z - q >= 0)
						{
							if (t != str[z - q])
							{
								d++;
							}
							continue;
						}
						d++;
					}
					if (d != 2)
					{
						t++;
						z--;
						continue;
					}
					str[z] = t;
					t = 'a';
				}
				if (u == 1)
				{
					continue;
				}
				cout << str;
				return 0;
			}
		}
	}
	cout << "NO";
}


#include <stdio.h>
using namespace std;
char s[5001];
int n,m;
int main(){
    scanf("%i %i",&n,&m);
    scanf("%s",&s);
    for(int i = n - 1; i >= 0 ; i --){
        for(int j = s[i] + 1; j <= m + 'a'-1 ; j ++)
            if(s[i-1] != j && s[i-2] != j){
                s[i] = j;
                  bool t = 1.;
                for(int ii = i + 1 ; ii < n ; ii ++){
                    t = 0;
                    for(int jj = 0 ; jj < m ; jj ++)
                        if(s[ii-1] != jj + 'a' && s[ii-2] != jj + 'a'){s[ii] = jj + 'a';t = 1;break;}
                    if(t)continue;
                    else goto a1;
                }
                a1:
                    if(t){
                        for(int i = 0 ; i < n ; i ++)
                            putchar(s[i]);
                        return 0;
                    }
            }
    }
    printf("NO");
}


#include <stdio.h>
using namespace std;
char s[5001];
int n,m;
int main(){
    scanf("%i %i",&n,&m);
    scanf("%s",&s);
    for(int i = n - 1; i >= 0 ; i --){
        for(int j = s[i] + 1; j <= m + 'a'-1 ; j ++)
            if(s[i-1] != j && s[i-2] != j){
                for(int ii = 0 ; ii < i; ii ++)
                    putchar(s[ii]);
                putchar(j);
                for(int ii = i + 1, t = 0 ; ii < n; ii ++)
                    if(t)putchar('a');
                    else {
                        if(s[i-1] == 'a') putchar('b');
                        else putchar('a');
                            t = 1;
                    }
                    return 0;
            }
    }
    printf("NO");
}


#include<iostream>
#include<string>
using namespace std;
int main(){
	int n,p;
	scanf("%d%d",&n,&p);
	p+='a';
	string s;
	cin>>s;
	for(int i=n-1;i>=0;i--)
		for(int j=s[i]+1;j<p;j++)
			if((!i || s[i-1]!=j) && (i<2 || s[i-2]!=j)){
				s[i]=j;
				for(i++;i<n;i++)
					for(j='a';j<p;j++)
						if((!i || s[i-1]!=j) && (i<2 || s[i-2]!=j)){
							s[i]=j;
							break;
						}
				cout<<s;
				return 0;
			}
	printf("NO");
}


/*
ID: Tariqul
PROG:
LANG: C++
*/

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define fo(i,j,n) for(i=j;i<n;++i)
#define Fo(i,j,n) for(i=n-1;i>=j;--i)
#define foo(i,j,v) fo(i,j,sz(v))
#define Foo(i,j,v) Fo(i,j,sz(v))
#define li(v) v.begin(),v.end()
#define sz(v) ((int)v.size())
#define CLR(a,v) memset((a),(v),sizeof(a))
#define inf 1000000001
//typedef long long Long;
typedef __int64 Long;
#define pi (2*acos(0))
#define eps 1e-9

#define two(X) (1<<(X))
#define twoL(X) (((Long)(1))<<(X))
#define contain(S,X) (((S)&two(X))!=0)
#define containL(S,X) (((S)&twoL(X))!=0)

char BUFFER[100000 + 5];
bool readn(int &n)	{ return scanf("%d",&n) == 1; }
bool readl(Long &n)	{ return scanf("%I64d",&n) == 1; }
bool readd(double &n){ return scanf("%lf",&n) == 1; }
bool reads(string &s){ s = ""; int n = scanf("%s",BUFFER); if(n == 1)s = BUFFER; return n == 1; }
bool readln(string &s){ char *valid = gets(BUFFER); if(valid)s = BUFFER; return ((bool)valid); }

string s;

void doit()
{
	int i,j,k,n,m;
	char ch;
	cin >> n >> m >> s;
	Fo(i,0,n)fo(j,0,m)
	{
		ch = 'a' + j;
		if(ch <= s[i])continue;
		if(i > 0 && ch == s[i-1])continue;
		if(i > 1 && ch == s[i-2])continue;
		s[i] = ch;
		fo(i,i+1,n)fo(j,0,m)
		{
			ch = 'a' + j;
			if(i > 0 && ch == s[i-1])continue;
			if(i > 1 && ch == s[i-2])continue;
			s[i] = ch;
			break;
		}
		cout << s;
		return;
	}
	cout << "NO";
}

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

	doit();

	printf("\n");
	return 0;
}


#include<stdio.h>
int n,p;
char temp;
char s[1010];
char judge(int x)
{
    for(char ch=s[x]+1;ch<='a'+p-1;ch++)
    {
        if(ch!=s[x-1]&&ch!=s[x-2])
            return ch;
    }
    return 0;
}
int main()
{
    scanf("%d%d",&n,&p);
    scanf("%s",s);
    int i;
    for(i=n-1;i>=0;i--)
    {
         temp=judge(i);
        if(temp)
        {
            s[i]=temp;break;
        }
    }
    if(i==-1)printf("NO\n");
    else
    {
        for(int j=i+1;j<n;j++)
        {
            s[j]='a'-1;
            s[j]=judge(j);
        }
        printf("%s\n",s);
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
int n;
    int pi;
void pa(string str,int n,int p[])
{
    int i;
    int mx = 0;
    int id=0;
    for(i=1; i<n; i++)
    {
        if( mx > i )
            p[i] = min( p[2*id-i], mx-i );
        else
            p[i] = 1;
        for(; (i+p[i]<n)&&(i-p[i]>=0)&&(str[i+p[i]] == str[i-p[i]]); p[i]++)
            ;
        if( p[i] + i > mx )
        {
            mx = p[i] + i;
            id = i;
        }
    }
}
bool check(string s){
    int n=s.size();
    string test="$";
    for(int i=0;i<n;i++){
        test.push_back('#');
        test.push_back(s[i]);
    }
    test.push_back('#');
    n=test.size();
    int p[1005]={0};
    pa(test,n,p);
    for(int i=0;i<n;i++){
        if(p[i]>2)
            return false;
    }
    return true;
}
bool addstr(string &s){
    string temp(s.size(),'a'+pi-1);
    if(temp==s)
        return false;
    for(int i=s.size()-1;i>=0;i--){
        if(s[i]<'a'+pi-1){
            s[i]++;

            for(int j=s.size()-1;j>i;j--){
                s[j]='a';
            }
            break;
        }

    }
    return true;

}
int main(){

    cin>>n>>pi;
    string s;
    cin>>s;
    while (addstr(s))
    {
        if(check(s)){
            cout<<s;
            return 0;
        }
    }
    cout<<"NO";
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
int n;
	int pi;
void pa(string str,int n,int p[])
{
    int i;
    int mx = 0;
    int id=0;
    for(i=1; i<n; i++)
    {
        if( mx > i )
            p[i] = min( p[2*id-i], mx-i );
        else
            p[i] = 1;
        for(; (i+p[i]<n)&&(i-p[i]>=0)&&(str[i+p[i]] == str[i-p[i]]); p[i]++)
            ;
        if( p[i] + i > mx )
        {
            mx = p[i] + i;
            id = i;
        }
		if(p[i]>2)
			break;
    }
}
bool check(string s){
	int n=s.size();
	string test="$";
	for(int i=0;i<n;i++){
		test.push_back('#');
		test.push_back(s[i]);
	}
	test.push_back('#');
	n=test.size();
	int p[1005]={0};
	pa(test,n,p);
	for(int i=0;i<n;i++){
		if(p[i]>2)
			return false;
	}
	return true;
}
bool addstr(string &s){
	string temp(s.size(),'a'+pi-1);
	if(temp==s)
		return false;
	for(int i=s.size()-1;i>=0;i--){
		if(s[i]<'a'+pi-1){
			s[i]++;

			for(int j=s.size()-1;j>i;j--){
				s[j]='a';
			}
			break;
		}

	}
	return true;

}
int main(){

	cin>>n>>pi;
	string s;
	cin>>s;
	while (addstr(s))
	{
		if(check(s)){
			cout<<s;
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<queue>
#include<iomanip>
#define rep(i,n,m) for (int i=n; i<m; i++)
#define repd(i,n,m) for (int i=n; i>m; i--)
using namespace std;
string s;
int p;
bool nex(int n,char beg)
    {
        while (1)
        {
            for (char c = beg; c<p+'a'; c++)
                if (c != s[n-1] && c != s[n-2])
                {
                    s[n]=c;
                    return 1;
                }
            if (n == 2 && s[n] == 'a'+p-1)
                return 0;
            if (n > 2)
                if (nex(n-1,beg=s[n-1]+1))
                    beg = 'a';else
                    return 0;
        }
        return 0;
    }
int main()
{
    int n;
    char c;
    cin >> n >> p;
    s = "00";
    rep(i,0,n)
        cin >>c, s.push_back(c);
    c = s[n+1]+1;
    if (nex(n+1,c))
    {
        rep(i,2,n+2)
            cout << s[i];
        cout << endl;
    }else
    cout << "NO\n";
    return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<queue>
#include<iomanip>
#define rep(i,n,m) for (int i=n; i<m; i++)
#define repd(i,n,m) for (int i=n; i>m; i--)
using namespace std;
string s;
string en;
int p;
bool nex(int n,char beg)
    {
        while (s != en)
        {
            for (char c = beg; c<p+'a'; c++)
                if (c != s[n-1] && c != s[n-2])
                {
                    s[n]=c;
                    return 1;
                }
            if (n > 2)
                if (nex(n-1,beg=s[n-1]+1))
                    beg = 'a';else
                    return 0;
            if (n == 2)
                return 0;
        }
        return 0;
    }
int main()
{
    int n;
    char c;
    cin >> n >> p;
    s = "00";
    en = "00";
    rep(i,0,n)
        cin >>c, s.push_back(c),en.push_back('a'+p-1);
    c = s[n+1]+1;
    if (nex(n+1,c))
    {
        rep(i,2,n+2)
            cout << s[i];
        cout << endl;
    }else
    cout << "NO\n";
    return 0;
}


//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<iostream>
#include<sstream>
#include<queue>
#include<math.h>
#include<stdlib.h>
#include<stack>
#include<string.h>
#include<string>
#include<map>
#include<algorithm>
#include<time.h>
#include<set>
#include<vector>
#include<numeric>
#include<iomanip>
using namespace std;

#define All(a) a.begin(), a.end()
#define _2d(a,row,col,type) type**a=new type*[row]; for (int i=0;i<row;i++) a[i]=new type[col];
#define rep(i,n) for(long i=0;i<int(n);i++)
#define repd(i,n) for(long i=n-1;i>=0;i--)
#define repi(i,a,n) for(ll i=int(a);i<int(n);i++)
#define scn(a,n) rep(i,n) cin>>a[i];
#define scn2(a,row,col) rep(i,row) rep(j,col) cin>>a[i][j];
#define prn(a,n) rep(i,n-1) cout<<a[i]<<" "; cout<<a[n-1]<<endl;
#define prn2(a,row,col) rep(i,row){rep(j,col-1) cout<<a[i][j]<<" "; cout<<a[i][col-1]<<endl;}
#define Odd(x) x%2!=0
#define Even(x) x%2==0
#define Pi 3.14
#define INF 2000000000 // 2 billion
#define sl(s) (long) s.lenght()

typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> ii;
typedef pair<int, string> is;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;

string s;
int n, p;

int neno(int pos,char c){
	if (pos == 0 && (c - 'a') < p)
		return (c - 'a');
	for (char i = c; (i - 'a') < p; i++){
		if ((pos > 0 && s[pos - 1] != i) && ( pos > 1 && s[pos - 2] != i)){
			return i - 'a';
		}
	}
	return -1;
}

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

	cin >> n >> p;
	//vi a(n);
	char c;
	cin >> s;
	/*rep(i, n){
		cin >> c;
		a[i] = c - 'a' + 1;
	}*/
	int x;
	bool ok = 1 , done = 0;
	repd(i, n){

		if ((x = neno(i, s[i] + 1)) != -1){
			s[i] = 'a' + x;
			if (i+1 == n) break;
			done = 1;
			repi(j, i + 1, n){
				if ((x = neno(j, 'a')) != -1){
					s[j] = 'a' + x;
				}
				else{
					ok = 0;
					break;
				}
			}
			if (!ok) {
				break;
			}
		}
		else if (!i) {
			ok = 0;
			break;
		}
		if (done) break;
	}
	ok ? cout << s : cout << "NO";
	return 0;

}


//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<iostream>
#include<sstream>
#include<queue>
#include<math.h>
#include<stdlib.h>
#include<stack>
#include<string.h>
#include<string>
#include<map>
#include<algorithm>
#include<time.h>
#include<set>
#include<vector>
#include<numeric>
#include<iomanip>
using namespace std;

#define All(a) a.begin(), a.end()
#define _2d(a,row,col,type) type**a=new type*[row]; for (int i=0;i<row;i++) a[i]=new type[col];
#define rep(i,n) for(long i=0;i<int(n);i++)
#define repd(i,n) for(long i=n-1;i>=0;i--)
#define repi(i,a,n) for(ll i=int(a);i<int(n);i++)
#define scn(a,n) rep(i,n) cin>>a[i];
#define scn2(a,row,col) rep(i,row) rep(j,col) cin>>a[i][j];
#define prn(a,n) rep(i,n-1) cout<<a[i]<<" "; cout<<a[n-1]<<endl;
#define prn2(a,row,col) rep(i,row){rep(j,col-1) cout<<a[i][j]<<" "; cout<<a[i][col-1]<<endl;}
#define Odd(x) x%2!=0
#define Even(x) x%2==0
#define Pi 3.14
#define INF 2000000000 // 2 billion
#define sl(s) (long) s.lenght()

typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> ii;
typedef pair<int, string> is;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;

string s;
int n, p;

int neno(int pos,char c){
	if (pos == 0 && (c - 'a') < p)
		return (c - 'a');
	for (char i = c; (i - 'a') < p; i++){
		if ((pos > 0 && s[pos - 1] != i) || ( pos > 1 && s[pos - 2] != i)){
			return i - 'a';
		}
	}
	return -1;
}

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

	cin >> n >> p;
	//vi a(n);
	char c;
	cin >> s;
	/*rep(i, n){
		cin >> c;
		a[i] = c - 'a' + 1;
	}*/
	int x;
	bool ok = 1 , done = 0;
	repd(i, n){

		if ((x = neno(i, s[i] + 1)) != -1){
			s[i] = 'a' + x;
			if (i+1 == n) break;
			done = 1;
			repi(j, i + 1, n){
				if ((x = neno(j, 'a')) != -1){
					s[j] = 'a' + x;
				}
				else{
					ok = 0;
					break;
				}
			}
			if (!ok) {
				break;
			}
		}
		else if (!i) {
			ok = 0;
			break;
		}
		if (done) break;
	}
	ok ? cout << s : cout << "NO";
	return 0;

}


//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<iostream>
#include<sstream>
#include<queue>
#include<math.h>
#include<stdlib.h>
#include<stack>
#include<string.h>
#include<string>
#include<map>
#include<algorithm>
#include<time.h>
#include<set>
#include<vector>
#include<numeric>
#include<iomanip>
using namespace std;

#define All(a) a.begin(), a.end()
#define _2d(a,row,col,type) type**a=new type*[row]; for (int i=0;i<row;i++) a[i]=new type[col];
#define rep(i,n) for(long i=0;i<int(n);i++)
#define repd(i,n) for(long i=n-1;i>=0;i--)
#define repi(i,a,n) for(ll i=int(a);i<int(n);i++)
#define scn(a,n) rep(i,n) cin>>a[i];
#define scn2(a,row,col) rep(i,row) rep(j,col) cin>>a[i][j];
#define prn(a,n) rep(i,n-1) cout<<a[i]<<" "; cout<<a[n-1]<<endl;
#define prn2(a,row,col) rep(i,row){rep(j,col-1) cout<<a[i][j]<<" "; cout<<a[i][col-1]<<endl;}
#define Odd(x) x%2!=0
#define Even(x) x%2==0
#define Pi 3.14
#define INF 2000000000 // 2 billion
#define sl(s) (long) s.lenght()

typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> ii;
typedef pair<int, string> is;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;

string s;
int n, p;

int neno(int pos,char c){
	if (pos == 0 && (c - 'a') < p)
		return (c - 'a');
	for (char i = c; (i - 'a') < p; i++){
		if (pos > 1 && s[pos -1] != i && s[pos-2] != i)
			return i - 'a';
		else if (pos == 1 && s[pos-1] != i)
			return i - 'a';
		}
	return -1;
}

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

	cin >> n >> p;
	//vi a(n);
	char c;
	cin >> s;
	/*rep(i, n){
		cin >> c;
		a[i] = c - 'a' + 1;
	}*/
	int x;
	bool ok = 1 , done = 0;
	repd(i, n){

		if ((x = neno(i, s[i] + 1)) != -1){
			s[i] = 'a' + x;
			if (i+1 == n) break;
			done = 1;
			repi(j, i + 1, n){
				if ((x = neno(j, 'a')) != -1){
					s[j] = 'a' + x;
				}
				else{
					ok = 0;
					break;
				}
			}
			if (!ok) {
				break;
			}
		}
		else if (!i) {
			ok = 0;
			break;
		}
		if (done) break;
	}
	ok ? cout << s : cout << "NO";
	return 0;

}


//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<iostream>
#include<sstream>
#include<queue>
#include<math.h>
#include<stdlib.h>
#include<stack>
#include<string.h>
#include<string>
#include<map>
#include<algorithm>
#include<time.h>
#include<set>
#include<vector>
#include<numeric>
#include<iomanip>
using namespace std;

#define All(a) a.begin(), a.end()
#define _2d(a,row,col,type) type**a=new type*[row]; for (int i=0;i<row;i++) a[i]=new type[col];
#define rep(i,n) for(long i=0;i<int(n);i++)
#define repd(i,n) for(long i=n-1;i>=0;i--)
#define repi(i,a,n) for(ll i=int(a);i<int(n);i++)
#define scn(a,n) rep(i,n) cin>>a[i];
#define scn2(a,row,col) rep(i,row) rep(j,col) cin>>a[i][j];
#define prn(a,n) rep(i,n-1) cout<<a[i]<<" "; cout<<a[n-1]<<endl;
#define prn2(a,row,col) rep(i,row){rep(j,col-1) cout<<a[i][j]<<" "; cout<<a[i][col-1]<<endl;}
#define Odd(x) x%2!=0
#define Even(x) x%2==0
#define Pi 3.14
#define INF 2000000000 // 2 billion
#define sl(s) (long) s.lenght()

typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> ii;
typedef pair<int, string> is;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;

string s;
int n, p;

int neno(int pos,char c){
	for (char i = c; (i - 'a') < p; i++){
		if ((pos > 0 && s[pos - 1] != i) && (pos > 1) && s[pos - 2] != i){
			return i - 'a';
		}
	}
	return -1;
}

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

	cin >> n >> p;
	//vi a(n);
	char c;
	cin >> s;
	/*rep(i, n){
		cin >> c;
		a[i] = c - 'a' + 1;
	}*/
	int x;
	bool ok = 1 , done = 0;
	repd(i, n){

		if ((x = neno(i, s[i] + 1)) != -1){
			s[i] = 'a' + x;
			if (i+1 == n) break;
			done = 1;
			repi(j, i + 1, n){
				if ((x = neno(j, 'a')) != -1){
					s[j] = 'a' + x;
				}
				else{
					ok = 0;
					break;
				}
			}
			if (!ok) {
				break;
			}
		}
		else if (!i) {
			ok = 0;
			break;
		}
		if (done) break;
	}
	ok ? cout << s : cout << "NO";
	return 0;

}


//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<iostream>
#include<sstream>
#include<queue>
#include<math.h>
#include<stdlib.h>
#include<stack>
#include<string.h>
#include<string>
#include<map>
#include<algorithm>
#include<time.h>
#include<set>
#include<vector>
#include<numeric>
#include<iomanip>
using namespace std;

#define All(a) a.begin(), a.end()
#define _2d(a,row,col,type) type**a=new type*[row]; for (int i=0;i<row;i++) a[i]=new type[col];
#define rep(i,n) for(long i=0;i<int(n);i++)
#define repd(i,n) for(long i=n-1;i>=0;i--)
#define repi(i,a,n) for(ll i=int(a);i<int(n);i++)
#define scn(a,n) rep(i,n) cin>>a[i];
#define scn2(a,row,col) rep(i,row) rep(j,col) cin>>a[i][j];
#define prn(a,n) rep(i,n-1) cout<<a[i]<<" "; cout<<a[n-1]<<endl;
#define prn2(a,row,col) rep(i,row){rep(j,col-1) cout<<a[i][j]<<" "; cout<<a[i][col-1]<<endl;}
#define Odd(x) x%2!=0
#define Even(x) x%2==0
#define Pi 3.14
#define INF 2000000000 // 2 billion
#define sl(s) (long) s.lenght()

typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> ii;
typedef pair<int, string> is;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;

string s;
int n, p;

int neno(int pos,char c){
	for (char i = c; (i - 'a') < p; i++){
		if ((pos > 0 && s[pos - 1] != i) && (pos > 1) && s[pos - 2] != i){
			return i - 'a';
		}
	}
	return -1;
}

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

	cin >> n >> p;
	//vi a(n);
	char c;
	cin >> s;
	/*rep(i, n){
		cin >> c;
		a[i] = c - 'a' + 1;
	}*/
	int x;
	bool ok = 1 , done = 0;
	repd(i, n){

		if ((x = neno(i, s[i] + 1)) != -1){
			s[i] = 'a' + x;
			if (i+1 == n) break;
			done = 1;
			repi(j, i + 1, n){
				if ((x = neno(j, 'a')) != -1){
					s[j] = 'a' + x;
				}
				else{
					ok = 0;
					break;
				}
			}
			if (!ok) {
				break;
			}
		}
		else if (i) {
			ok = 0;
			break;
		}
		if (done) break;
	}
	ok ? cout << s : cout << "NO";
	return 0;

}


#include<cstdio>
#include<string>
#include<iostream>
using namespace std;
string s;
inline bool isNotPald(int n){
    for(int i = 1;i <= n;i ++){
        if(s[i-1] == s[i]) return false;
    }
    for(int i = 1;i < n;i ++){
        if(s[i-1] == s[i+1]) return false;
    }
    return true;
}
int main(){
    int n,m;
    cin >> n >> m;
    cin >> s;
    for(int i = s.size()-1;i >= 0;i --){
        for(char j = s[i] + 1;j < 'a' + m;j ++){
            s[i] = j;
            if(isNotPald(i)){
                for(int k = i + 1;k < n;k ++){
                    for(char ch = 'a';ch < 'a' + m; ch++){
                        s[k] = ch;
                        if(isNotPald(k)) break;
                    }
                }
                cout << s << endl;
                return 0;
            }
        }
    }
    cout << "NO" << endl;
    return 0;
}


#include <iostream>
using namespace std;

	bool boo = true;
	char c[1000];
	int n,p;

void rec (int last)
{
	if (boo)
	{
		c[last] ++;
		if (int(c[last] - 'a') >= p)
		{
			c[last] = 'a';
			if (last == 0)
			{
				boo = false;
				return;
			}
			else
				rec(last-1);
		}

		if ((last>0 && c[last-1] == c[last]) || (last > 1 && c[last-2] == c[last]))
			rec(last);
	}
}
void main()
{

	cin >> n >> p;

	for (int i = 0; i < n; i++)
		cin >> c[i];

	if (n == 1)
	{
		c[0]++;
		if (int(c[0] - 'a') >= p)
			boo = false;
	}
	else
		rec(n-1);

	if (boo)
		for (int i = 0; i<n; i++)
			cout << c[i];
	else
		cout << "NO";

	system("pause");

}


#include <iostream>
using namespace std;

	bool boo = true;
	char c[1000];
	int n,p;

void rec (int last)
{
	if (boo)
	{
		c[last] ++;
		if (int(c[last] - 'a') >= p)
		{
			c[last] = 'a';
			if (last == 0)
			{
				boo = false;
				return;
			}
			else
				rec(last-1);
		}

		if ((last>0 && c[last-1] == c[last]) || (last > 1 && c[last-2] == c[last]))
			rec(last);
	}
}
void main()
{

	cin >> n >> p;

	for (int i = 0; i < n; i++)
		cin >> c[i];

	if (n == 1)
	{
		c[0]++;
		if (int(c[0] - 'a') >= p)
			boo = false;
	}
	else
		rec(n-1);

	if (boo)
		for (int i = 0; i<n; i++)
			cout << c[i];
	else
		cout << "NO";

	//system("pause");

}


#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <map>
#include <vector>
#include <set>

using namespace std;

bool f=true;
int n,p,i,j,k,d;
char x[2],c,a,y[3];
string s;
int main()
{
    cin>>n;
    cin>>k;
    cin>>s;
    if(k==1)
    {
        cout<<"NO";
        return 0;
    }
    if(k==2)
    {
        if(s[0]=='b')
        {
            cout<<"NO";
            return 0;
        }
        c='b';
        for(i=0;i<n;i++)
        {
            cout<<c;
            if(c=='a') c++;
            else c='a';
        }
        return 0;
    }
    for(i=n-1;i>=0;i--)
    {
       p=int(s[i])-int('a')+1;
       if(p<k)
       {
           for(j=0;j<2;j++) x[j]='~';
           if(i-2>=0)
           {
               x[0]=s[i-2];
           }
           if(i-1>=0)
           {
               x[1]=s[i-1];
           }
           for(j=p;j<k;j++)
           {
               f=true;
               c=char(j+int('a'));
               for(d=0;d<2;d++)
               {
                   if(c==x[d])
                   {
                        f=false;
                        break;
                   }
               }
               if(f)
               {
                   s[i]=c;
                   x[0]=c;
                   for(j=0;j<=i;j++) cout<<s[j];
                   if(i+1==n) return 0;
                   c='a';
                   for(d=0;d<2;d++)
                   {
                       if(x[d]==c)
                       {
                           c='b';
                           break;
                       }
                   }
                   if(c=='b')
                   {
                       for(d=0;d<2;d++)
                       {
                           if(x[d]==c)
                           {
                               c='c';
                               break;
                           }
                       }
                   }
                   if(c=='a')
                   {
                       y[0]='a';
                       if(s[i]!='b')
                       {
                        y[1]='b';
                        y[2]='c';
                       }
                       else
                       {
                           y[1]='c';
                           y[2]='b';
                       }
                   }
                   if(c=='b')
                   {
                       y[0]='b';
                       if(s[i]!='a')
                       {
                        y[1]='a';
                        y[2]='c';
                       }
                       else
                       {
                           y[1]='c';
                           y[2]='a';
                       }
                   }
                   if(c=='c')
                   {
                       y[0]='c';
                       if(s[i]!='a')
                       {
                        y[1]='a';
                        y[2]='b';
                       }
                       else
                       {
                           y[1]='b';
                           y[2]='a';
                       }
                   }
                   d=0;
                   for(j=i+1;j<n;j++)
                   {
                       cout<<y[d];
                       if(d!=2) d++;
                       else d=0;
                   }
                   return 0;
               }
            }
        }
}
    cout<<"NO";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <map>
#include <vector>
#include <set>

using namespace std;

bool f=true;
int n,p,i,j,k,d;
char x[2],c,a,y[3];
string s;
int main()
{
    cin>>n;
    cin>>k;
    cin>>s;
    if(k==1)
    {
        cout<<"NO";
        return 0;
    }
    if(k==2)
    {
        if(s[0]=='b')
        {
            cout<<"NO";
            return 0;
        }
        c='a';
        for(i=0;i<n;i++)
        {
            cout<<c;
            if(c=='a') c++;
            else c='a';
        }
        return 0;
    }
    for(i=n-1;i>=0;i--)
    {
       p=int(s[i])-int('a')+1;
       if(p<k)
       {
           for(j=0;j<2;j++) x[j]='~';
           if(i-2>=0)
           {
               x[0]=s[i-2];
           }
           if(i-1>=0)
           {
               x[1]=s[i-1];
           }
           for(j=p;j<k;j++)
           {
               f=true;
               c=char(j+int('a'));
               for(d=0;d<2;d++)
               {
                   if(c==s[d])
                   {
                        f=false;
                        break;
                   }
               }
               if(f)
               {
                   s[i]=c;
                   x[0]=c;
                   for(j=0;j<=i;j++) cout<<s[j];
                   if(i+1==n) return 0;
                   c='a';
                   for(d=0;d<2;d++)
                   {
                       if(x[d]==c)
                       {
                           c='b';
                           break;
                       }
                   }
                   if(c=='b')
                   {
                       for(d=0;d<2;d++)
                       {
                           if(x[d]==c)
                           {
                               c='c';
                               break;
                           }
                       }
                   }
                   if(c=='a')
                   {
                       y[0]='a';
                       if(s[i]!='b')
                       {
                        y[1]='b';
                        y[2]='c';
                       }
                       else
                       {
                           y[1]='c';
                           y[2]='b';
                       }
                   }
                   if(c=='b')
                   {
                       y[0]='b';
                       if(s[i]!='a')
                       {
                        y[1]='a';
                        y[2]='c';
                       }
                       else
                       {
                           y[1]='c';
                           y[2]='a';
                       }
                   }
                   if(c=='c')
                   {
                       y[0]='c';
                       if(s[i]!='a')
                       {
                        y[1]='a';
                        y[2]='b';
                       }
                       else
                       {
                           y[1]='b';
                           y[2]='a';
                       }
                   }
                   d=0;
                   for(j=i+1;j<n;j++)
                   {
                       cout<<y[d];
                       if(d!=2) d++;
                       else d=0;
                   }
                   return 0;
               }
            }
        }
}
    cout<<"NO";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <map>
#include <vector>
#include <set>

using namespace std;

bool f=true;
int n,p,i,j,k,d;
char x[2],c,a,y[3];
string s;
int main()
{
    cin>>n;
    cin>>k;
    cin>>s;
    if(k==1)
    {
        cout<<"NO";
        return 0;
    }
    if(k==2)
    {
        if(s[0]=='b')
        {
            cout<<"NO";
            return 0;
        }
        c='b';
        for(i=0;i<n;i++)
        {
            cout<<c;
            if(c=='a') c++;
            else c='a';
        }
        return 0;
    }
    for(i=n-1;i>=0;i--)
    {
       p=int(s[i])-int('a')+1;
       if(p<k)
       {
           for(j=0;j<2;j++) x[j]='~';
           if(i-2>=0)
           {
               x[0]=s[i-2];
           }
           if(i-1>=0)
           {
               x[1]=s[i-1];
           }
           for(j=p;j<k;j++)
           {
               f=true;
               c=char(j+int('a'));
               for(d=0;d<2;d++)
               {
                   if(c==s[d])
                   {
                        f=false;
                        break;
                   }
               }
               if(f)
               {
                   s[i]=c;
                   x[0]=c;
                   for(j=0;j<=i;j++) cout<<s[j];
                   if(i+1==n) return 0;
                   c='a';
                   for(d=0;d<2;d++)
                   {
                       if(x[d]==c)
                       {
                           c='b';
                           break;
                       }
                   }
                   if(c=='b')
                   {
                       for(d=0;d<2;d++)
                       {
                           if(x[d]==c)
                           {
                               c='c';
                               break;
                           }
                       }
                   }
                   if(c=='a')
                   {
                       y[0]='a';
                       if(s[i]!='b')
                       {
                        y[1]='b';
                        y[2]='c';
                       }
                       else
                       {
                           y[1]='c';
                           y[2]='b';
                       }
                   }
                   if(c=='b')
                   {
                       y[0]='b';
                       if(s[i]!='a')
                       {
                        y[1]='a';
                        y[2]='c';
                       }
                       else
                       {
                           y[1]='c';
                           y[2]='a';
                       }
                   }
                   if(c=='c')
                   {
                       y[0]='c';
                       if(s[i]!='a')
                       {
                        y[1]='a';
                        y[2]='b';
                       }
                       else
                       {
                           y[1]='b';
                           y[2]='a';
                       }
                   }
                   d=0;
                   for(j=i+1;j<n;j++)
                   {
                       cout<<y[d];
                       if(d!=2) d++;
                       else d=0;
                   }
                   return 0;
               }
            }
        }
}
    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);
	int t;
	cin >> t;
	while(t--){
		string s;
		cin >> s;
		if(s.length()<=1){
			cout << s << "\n";
			continue;
		}
		for(int i=0; i<s.length(); i++){
			if(i==int(s.length())-1) cout << s[i];
			else if(s[i]!=s[i+1]) cout << s[i];
			else i++;
		}
		cout << "\n";
	}
}


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

int main()
{

    int n;
    cin>>n;
    while(n--)
    {
        vector<char> alp;
        bool visited[26]={false};
        int res[26]={0};
        bool rep[26]={false};
        string str;
        cin>>str;
        for(int i=0;i<str.length();i++)
            {
             int x= (int)str[i]-97;
            if(str[i]==str[i+1]&&i<str.length()-1)
                rep[x]=true;
            if(i==str.length()-1&&str[i-1]!=str[i])
                rep[x]=false;
            else if((str[i]!=str[i+1]&&str[i-1]!=str[i]&&rep[x]))
                rep[x]=false;
            res[x]++;
            }
       for(int i=0;i<26;i++)
        {
            if((res[i]%2!=0||!rep[i])&&res[i]>0)
                alp.push_back((char)(i+97));
        }
        sort(alp.begin(),alp.end());
        for(auto i:alp)
            cout<<i;
        cout<<endl;

    }
    return 0;
    }


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

int main()
{

    int n;
    cin>>n;
    while(n--)
    {
        vector<char> alp;
        int res[26]={0};
        bool visited[26]={false};
        string str;
        cin>>str;
        for(int i=0;i<str.length();i++)
            res[(int)str[i]-97]++;
        for(int i=0;i<str.length();i++)
                if(res[(int)str[i]-97]%2!=0&&!visited[(int)str[i]-97])
                    {
                        alp.push_back(str[i]);
                        visited[(int)str[i]-97]=true;

                    }
        sort(alp.begin(),alp.end());
        for(auto i:alp)
            cout<<i;
        cout<<endl;

    }
    return 0;
    }


#include<iostream>

using namespace std;

int main()
{

    int n;
    cin>>n;
    while(n--)
    {
        int res[26]={0};
        bool visited[26]={false};
        string str;
        cin>>str;
        for(int i=0;i<str.length();i++)
            res[(int)str[i]-97]++;
        for(int i=0;i<str.length();i++)
                if(res[(int)str[i]-97]%2!=0&&!visited[(int)str[i]-97])
                    {
                        cout<<str[i];
                        visited[(int)str[i]-97]=true;

                    }
                    cout<<endl;

    }
    return 0;
    }


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

int main()
{
    int n;
    cin>>n;
    while(n--)
    {
        bool alp[26]={false};
        string str;
        cin>>str;
        for(int i=0;i<str.length();i++)
        {
            int x=1;
            while(str[i]==str[i+1])
                {
                    x++;
                    i++;
                    if(i==str.length()-1)
                        break;
                }
                if(x%2!=0)
                    alp[str[i]-97]=true;
        }
        for(int i=0;i<26;i++)
            if(alp[i])
                cout<<(char)(i+97);
        cout<<endl;
    }
}


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

int main()
{

    int n;
    cin>>n;
    while(n--)
    {
        bool rep[26]={false};
        string str;
        cin>>str;
        for(int i=0;i<str.length();i++)
            {
             int x= (int)str[i]-97;
            if(i==0&&str[i+1]!=str[i])
                rep[x]=true;
            else if(i==str.length()-1&&str[i-1]!=str[i])
                rep[x]=true;
            else if((str[i]!=str[i+1]&&str[i-1]!=str[i]))
                rep[x]=true;
            }
       for(int i=0;i<26;i++)
        {
            if(rep[i])
                cout<<(char)(i+97);
        }
        cout<<endl;

    }
    return 0;
    }


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

int main()
{

    int n;
    cin>>n;
    while(n--)
    {
        bool rep[26]={false};
        int res[26]={0};
        string str;
        cin>>str;
        for(int i=0;i<str.length();i++)
            {
             int x= (int)str[i]-97;
             res[x]++;
            if(i==0&&str[i+1]!=str[i])
                rep[x]=true;
            else if(i==str.length()-1&&str[i-1]!=str[i])
                rep[x]=true;
            else if((str[i]!=str[i+1]&&str[i-1]!=str[i]))
                rep[x]=true;
            }
       for(int i=0;i<26;i++)
        {
            if(rep[i]||(res[i]&&res[i]%2!=0))
                cout<<(char)(i+97);
        }
        cout<<endl;

    }
    return 0;
    }


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

int main()
{

    int n;
    cin>>n;
    while(n--)
    {
        vector<char> alp;
        bool visited[26]={false};
        int res[26]={0};
        bool rep[26]={false};
        string str;
        cin>>str;
        for(int i=0;i<str.length();i++)
            {
             int x= (int)str[i]-97;
            if(str[i]==str[i+1]&&i<str.length()-1)
                rep[x]=true;
            res[x]++;
            }
       for(int i=0;i<26;i++)
        {
            if((res[i]%2!=0||!rep[i])&&res[i]>0)
                alp.push_back((char)(i+97));
        }
        sort(alp.begin(),alp.end());
        for(auto i:alp)
            cout<<i;
        cout<<endl;

    }
    return 0;
    }


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

int main()
{

    ios_base::sync_with_stdio(false);
    int t;
    cin>>t;
    while(t--)
    {
        string s1,s2;
        cin>>s1;
        int i=0;
        while(s1[i]!='\0')
        {
            if(s1[i]!=s1[i+1]){
                s2+=s1[i];
                i++;
            }
            else
                i+=2;
        }
        sort(s2.begin(),s2.end());
        cout<<s2<<"\n";
    }
    return 0;
}


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

int main()
{

    ios_base::sync_with_stdio(false);
    int t;
    cin>>t;
    while(t--)
    {
        long long int ar[150];
        memset(ar,0,sizeof(ar));
        string s1,s2;
        getline(cin,s1);
        int i=0,k;
        while(s1[i]!='\0')
        {
            k=s1[i];
            ar[k]++;
            i++;
        }
        for(i=97;i<=125;i++)
        {
            if(ar[i]!=0 && ar[i]%2!=0)
            {
                char c=i;
                cout<<c;
            }
        }
        cout<<"\n";
    }
    return 0;
}


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

int main()
{

   // ios_base::sync_with_stdio(false);
    int t;
    cin>>t;
    getchar();
    while(t--)
    {
        long long int ar[150];
        memset(ar,0,sizeof(ar));
        string s1,s2;
        getline(cin,s1);
        int i=0,k;
        while(s1[i]!='\0')
        {
            k=s1[i];
            ar[k]++;
            i++;
        }
        for(i=97;i<=125;i++)
        {
            if(ar[i]!=0 && ar[i]%2!=0)
            {
                char c=i;
                cout<<c;
            }
        }
        cout<<"\n";
    }
    return 0;
}


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

int main()
{

    //ios_base::sync_with_stdio(false);
    int t;
    cin>>t;
    getchar();
    while(t--)
    {
        string s;
        getline(cin,s);
        set <char> st;
        set <char>::iterator it;
        int n=s.size();

        for(int i=0;i<n;)
        {
            //cout<<s[i]<<" "<<s[i+1]<<endl;
            if(s[i]!=s[i+1] || s[i+1]=='\0')
            {
                st.insert(s[i]);
                i++;
                //cout<<i<<" "<<"!"<<endl;
            }
            else
                i+=2;
        }
        for(it=st.begin();it!=st.end();it++)
            cout<<*it;

        cout<<"\n";
    }
    return 0;
}