302 4
abdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcb
 300 3
abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc
 10 10
fajegfaicb
 70 4
dcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbd
 100 4
abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabca
 5 5
aceba
 3 4
cdb
 2 2
ab
 11 3
abcabcabcab
 3 26
yzx
 2 4
cd
 7 26
zyxzyxz
 3 3
acb
 1 2
a
 77 7
cadgbagbcaecgfaegcdbeafbacbdfgaedgcdeabgebaecbeacgfebagedcegdafdgeacegfegfegf
 1 26
o
 10 3
cbacbacbac
 10 5
abcabcabca
 26 26
ahnxdnbfcriersyzdihuecojdi
 1 2
b
 13 7
gfegfegfegfeg
 1 1
a
 6 3
acbacb
 17 26
bazyxzyxzyxzyxzyx
 12 10
abcabcabcabc
 333 5
edcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedcedc
 1 26
z
 3 3
cab
 15 11
cgjkbadjfbdaikj
 6 3
abcabc
 17 4
dabcadcbdcadbcdbc
 30 7
cedcfedcfgcfgcbadcadgfaegfacgf
 30 26
abcabcabczyxzyxzyxzyxzyxzyxzyx
 2 2
ba

acbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbac
 acbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacb
 fajegfaicd
 NO
 abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcd
 acebc
 dab
 ba
 acbacbacbac
 zab
 da
 NO
 bac
 b
 cadgbagbcaecgfaegcdbeafbacbdfgaedgcdeabgebaecbeacgfebagedcegdafdgeacfabcabcab
 p
 NO
 abcabcabcd
 ahnxdnbfcriersyzdihuecojdk
 NO
 NO
 NO
 bacbac
 bcabcabcabcabcabc
 abcabcabcabd
 NO
 NO
 cba
 cgjkbadjfbdajba
 acbacb
 dabcadcbdcadcabca
 cedcfedcfgcfgcbadcadgfaegfadba
 abcabcabdabcabcabcabcabcabcabc
 NO

import java.util.Stack;
import java.util.HashMap;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.StringTokenizer;
import java.util.ArrayList;

public class C2
{
    static char[]    s;

    static char[]    prefix;

    static boolean[] initial;

    static int[]     initVal;

    static String lastSave = "";


    public static void main(String[] args)
    {
        Scanner in = new Scanner();

        int n = in.nextInt();
        int p = in.nextInt();
        s = in.readNextLine().toCharArray();

        prefix = new char[n];
        initial = new boolean[n];

        for (int i = 0; i < n; i++)
        {
            prefix[i] = s[i];
            initial[i] = true;
        }

        int[] maxes = new int[s.length]; // start point for words
        for (int i = 0; i < maxes.length; i++)
        {
            maxes[i] = s[i] - 'a';
        }

        if (n == 1)
        {
            int ind = s[0] - 'a';
            if (ind < p - 1 && ind != -1)
            {
                System.out.println((char)(ind + 'a' + 1));
            }
            else
            {
                System.out.println("NO");
            }

            return;
        }

        // generate new string lexographically higher up
        // make sure its not a palindrome
        genS(p, maxes, n, n - 1, false);

        System.out.println("NO");
    }


    // level is elements in suffix array
    public static void genS(int p, int[] maxes, int length, int level, boolean increase)
    {
        // full length word is formed
        if (level == length)
        {
            String temp = new String(prefix);
            if (temp.compareTo(new String(s)) > 0)
            {
                if (!isPalindrome(temp))
                {
                    System.out.println(temp);
                    System.exit(0);
                }
            }

            return;
        }

        if (isPalindrome(new String(prefix).substring(0, level)))
        {
            genS(p, maxes, length, level - 1, false);
        }
        else
        // continue word generation
        {
            if (initial[level])
            {
                initial[level] = false;
                for (int i = maxes[level] + 1; i < p; i++)
                {
                    prefix[level] = (char)('a' + i);
                    if (!isPalindrome(new String(prefix).substring(0, level)))
                    {
                        // only continues gen if prefix isn't a palindrome
                        genS(p, maxes, length, level + 1, true);
                    }
                }
            }
            else
            {
                int start = 0;
                if (!increase)
                {
                    start = prefix[level] - 'a';
                }

                for (int i = start; i < p; i++)
                {
                    prefix[level] = (char)('a' + i);
                    if (!isPalindrome(new String(prefix).substring(0, level+1)))
                    {
                        // only continues gen if prefix isn't a palindrome
                        genS(p, maxes, length, level + 1, true);
                    }
                }
            }

            // gets here if none of the letters aren't palindromes
            // breaks off a letter and continues
            if (level == 0)
            {
                // got through all first letter combinations
                System.out.println("NO");
                System.exit(0);
            }
            else
            {
                if (new String(prefix).equals(lastSave))
                {
                    // starting to loop
                    System.out.println("NO");
                    System.exit(0);
                }
                lastSave = new String(prefix).substring(0, level);
                genS(p, maxes, length, level - 1, false);
            }
        }
    }


    // takes in str of any length
    public static boolean isPalindrome(String s)
    {
        if (s.length() < 2)
        {
            return false;
        }

        String twoBefore = String.valueOf(s.charAt(0));
        String oneBefore = String.valueOf(s.charAt(1));

        if (twoBefore.equals(oneBefore))
        {
            return true;
        }

        if (s.length() == 2)
        {
            return false;
        }

        for (int i = 2; i < s.length(); i++)
        {
            String temp = String.valueOf(s.charAt(i));

            if (temp.equals(oneBefore) || temp.equals(twoBefore))
            {
                return true;
            }

            twoBefore = oneBefore;
            oneBefore = temp;
        }

        return false;
    }


    // -----------Pair class for comparisons--------------
    public static class Pair
        implements Comparable<Pair>
    {
        int x, y;


        public Pair(int x, int y)
        {
            this.x = x;
            this.y = y;
        }


        @Override
        public int compareTo(Pair o)
        {
            return Integer.compare(this.x, o.x);
        }


        @Override
        public int hashCode()
        {
            return x ^ y;
        }


        @Override
        public boolean equals(Object o)
        {
            Pair p = (Pair)o;
            return p.x == x && p.y == y;
        }
    }


    // -----------Scanner class for faster input----------
    /*
     * Provides similar API as java.util.Scanner but does not use regular
     * expression engine.
     */
    public static class Scanner
    {
        BufferedReader  br;
        StringTokenizer st;


        public Scanner(Reader in)
        {
            br = new BufferedReader(in);
        }


        public Scanner()
        {
            this(new InputStreamReader(System.in));
        }


        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }


        int nextInt()
        {
            return Integer.parseInt(next());
        }


        long nextLong()
        {
            return Long.parseLong(next());
        }


        double nextDouble()
        {
            return Double.parseDouble(next());
        }


        // Slightly different from java.util.Scanner.nextLine(),
        // which returns any remaining characters in current line,
        // if any.
        String readNextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    // --------------------------------------------------------
}
