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 C
{
    static String poss     = "";

    static char[] alphabet = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
        'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
        'x', 'y', 'z'     };

    static String s;


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

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

        ArrayList<String> arr = new ArrayList<String>(); // subarray with
// allowed characters
        char[] cin = new char[p];
        for (int i = 0; i < p; i++)
        {
            arr.add(String.valueOf(alphabet[i]));
            cin[i] = alphabet[i];
        }

        int[] maxes = new int[s.length()];
        for (int i = 0; i < maxes.length; i++)
        {
            maxes[i] = arr.indexOf(String.valueOf(s.charAt(i)));
        }

        if (n == 1)
        {
            int ind = arr.indexOf(s.charAt(0));

            if (ind < arr.size() - 1 && ind != -1)
            {
                System.out.println(arr.get(ind++));
            }
            else
            {
                System.out.println("NO");
            }

            return;
        }

        StringBuilder build = new StringBuilder();
        boolean[] used = new boolean[p];
        // generate new string lexographically higher up
        // make sure its not a palindrome
        genS(cin, build, used, n, 0);

        System.out.println("NO");

    }


    public static void genS(
        char[] in,
        StringBuilder out,
        boolean[] used,
        int length,
        int level)
    {
        // char in = alphabet

        if (level == length)
        {
            String temp = out.toString();
            if (temp.compareTo(s) > 0)
            {
                if (!palindromeCheck(temp))
                {
                    System.out.println(temp);
                    System.exit(0);
                }
            }

            return;
        }

        for (int i = 0; i < in.length; i++)
        {
            out.append(in[i]);
            used[i] = true;
            genS(in, out, used, length, level + 1);
            used[i] = false;
            out.setLength(out.length() - 1);
        }
    }


    // assumes len(s) >= 2
    public static boolean palindromeCheck(String s)
    {
        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;
        }
    }
    // --------------------------------------------------------
}
