using System;
using System.Linq;
using CompLib.Util;
using System.Threading;
using CompLib.Mathematics;
using CompLib.String;

public class Program
{
    int N;
    string S;
    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        S = sc.Next();

        int cnt = 0;
        int min = 0;
        foreach (var c in S)
        {
            if (c == '(') cnt++;
            else cnt--;
            min = Math.Min(min, cnt);
        }
        /*
         * Sを部分文字列に含むカッコ列の個数
         */

        // iで間違えたときどこに飛ぶか?
        int[] next = new int[S.Length];
        for (int i = 0; i < S.Length; i++)
        {
            if (i == 0)
            {
                next[i] = 0;
                continue;
            }

            bool f2 = false;
            for (int len = i; len >= 1; len--)
            {
                bool f = true;
                for (int j = 0; f && j < len - 1; j++)
                {
                    f &= S[j] == S[i - len + 1 + j];
                }
                if (!f) continue;
                if (S[len - 1] != S[i])
                {
                    next[i] = len;
                    f2 = true;
                    break;
                }
            }

        }

        // i文字目まで作る、カウンタ、Sより前、Sより後, Sの何文字までできたか?
        var dp = new ModInt[2 * N + 1, N + 1, S.Length, 2];
        dp[0, 0, 0, 0] = 1;
        for (int i = 0; i < 2 * N; i++)
        {
            for (int j = 0; j <= N; j++)
            {
                for (int k = 0; k < S.Length; k++)
                {
                    // (
                    if (j + 1 <= N)
                    {
                        if (S[k] == '(')
                        {
                            if (k + 1 == S.Length)
                            {
                                dp[i + 1, j + 1, 0, 1] += dp[i, j, k, 0];
                            }
                            else
                            {
                                dp[i + 1, j + 1, k + 1, 0] += dp[i, j, k, 0];
                            }
                        }
                        else
                        {
                            // どこに飛ぶ
                            dp[i + 1, j + 1, next[k], 0] += dp[i, j, k, 0];
                        }

                    }

                    if (j - 1 >= 0)
                    {
                        if (S[k] == ')')
                        {
                            if (k + 1 == S.Length)
                            {
                                dp[i + 1, j - 1, 0, 1] += dp[i, j, k, 0];
                            }
                            else
                            {
                                dp[i + 1, j - 1, k + 1, 0] += dp[i, j, k, 0];
                            }
                        }
                        else
                        {
                            dp[i + 1, j - 1, next[k], 0] += dp[i, j, k, 0];
                        }

                    }
                }

                if (j + 1 <= N)
                {
                    dp[i + 1, j + 1, 0, 1] += dp[i, j, 0, 1];
                }
                if (j - 1 >= 0)
                {
                    dp[i + 1, j - 1, 0, 1] += dp[i, j, 0, 1];
                }
            }
        }

        Console.WriteLine(dp[2 * N, 0, 0, 1]);
    }

    public static void Main(string[] args) => new Program().Solve();
    // public static void Main(string[] args) => new Thread(new Program().Solve, 1 << 27).Start();
}

namespace CompLib.String
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    public static partial class StringACL
    {
        private const int ThresholdNative = 10;
        private const int ThresholdDoubling = 40;

        #region SuffixArray
        public static int[] SuffixArray(int[] s, int upper)
        {
            Debug.Assert(0 <= upper);

            // C++みたいに内部で何もしないループをスキップするのか?
            // してくれるなら #ifいらない
#if DEBUG
            foreach (var d in s)
            {
                Debug.Assert(0 <= d && d <= upper);
            }
#endif
            return SAIS(s, upper);
        }

        public static int[] SuffixArray<T>(T[] s, Comparison<T> cmp)
        {
            int n = s.Length;
            int[] idx = new int[n];
            for (int i = 0; i < n; i++)
            {
                idx[i] = i;
            }

            Array.Sort(idx, (l, r) => cmp(s[l], s[r]));

            int[] s2 = new int[n];
            int now = 0;
            for (int i = 0; i < n; i++)
            {
                if (0 < i && cmp(s[idx[i - 1]], s[idx[i]]) != 0) now++;
                s2[idx[i]] = now;
            }

            return SAIS(s2, now);
        }
        public static int[] SuffixArray<T>(T[] s)
        {
            return SuffixArray(s, Comparer<T>.Default.Compare);
        }

        /// <summary>
        /// 長さnの文字列のsuffixArrayを返す
        /// </summary>
        /// <remarks>
        /// <para>{0,1,2,...,n-1}の順列、s[sa[i],n) < s[sa[i+1],n)</para>
        /// <para>suffixArrayの辞書順</para>
        /// </remarks>
        /// <param name="s"></param>
        /// <returns></returns>
        public static int[] SuffixArray(string s)
        {
            int n = s.Length;
            int[] s2 = new int[n];
            for (int i = 0; i < n; i++)
            {
                s2[i] = s[i];
            }
            return SAIS(s2, 255);
        }

        // O(n^2)
        private static int[] SANative(int[] s)
        {
            int n = s.Length;
            int[] sa = new int[n];
            for (int i = 0; i < n; i++)
            {
                sa[i] = i;
            }
            Array.Sort(sa, (l, r) =>
             {
                 // 同じなら0
                 if (l == r) return 0;
                 // 順番に見る
                 while (l < n && r < n)
                 {

                     if (s[l] != s[r]) return s[l].CompareTo(s[r]);
                     l++;
                     r++;
                 }

                 // indexが大きい方が辞書順で小さい
                 return r.CompareTo(l);
             });
            return sa;
        }
        private static int[] SADoubling(int[] s)
        {
            int n = s.Length;
            int[] sa = new int[n];
            int[] rnk = new int[n];
            int[] tmp = new int[n];
            Array.Copy(s, rnk, n);
            for (int i = 0; i < n; i++)
            {
                sa[i] = i;
            }

            for (int k = 1; k < n; k *= 2)
            {
                Comparison<int> cmp = (int x, int y) =>
                {
                    if (rnk[x] != rnk[y]) return rnk[x].CompareTo(rnk[y]);
                    int rx = x + k < n ? rnk[x + k] : -1;
                    int ry = y + k < n ? rnk[y + k] : -1;
                    return rx.CompareTo(ry);
                };

                Array.Sort(sa, cmp);
                tmp[sa[0]] = 0;
                for (int i = 1; i < n; i++)
                {
                    tmp[sa[i]] = tmp[sa[i - 1]] + (cmp(sa[i - 1], sa[i]) < 0 ? 1 : 0);
                }

                var t = tmp;
                tmp = rnk;
                rnk = t;
            }

            return sa;
        }

        private static int[] SAIS(int[] s, int upper)
        {
            int n = s.Length;
            if (n == 0) return new int[0];
            if (n == 1) return new int[1];
            if (n == 2)
            {
                if (s[0] < s[1])
                {
                    return new int[] { 0, 1 };
                }
                else
                {
                    return new int[] { 1, 0 };
                }
            }

            if (n < ThresholdNative)
            {
                return SANative(s);
            }

            if (n < ThresholdDoubling)
            {
                return SADoubling(s);
            }

            int[] sa = new int[n];
            bool[] ls = new bool[n];

            for (int i = n - 2; i >= 0; i--)
            {
                ls[i] = (s[i] == s[i + 1]) ? ls[i + 1] : (s[i] < s[i + 1]);
            }

            int[] sumL = new int[upper + 1];
            int[] sumS = new int[upper + 1];

            for (int i = 0; i < n; i++)
            {
                if (!ls[i])
                {
                    sumS[s[i]]++;
                }
                else
                {
                    sumL[s[i] + 1]++;
                }
            }

            for (int i = 0; i <= upper; i++)
            {
                sumS[i] += sumL[i];
                if (i < upper) sumL[i + 1] += sumS[i];
            }

            Action<List<int>> induce = (List<int> lms) =>
          {
              for (int i = 0; i < n; i++)
              {
                  sa[i] = -1;
              }

              int[] buf = new int[upper + 1];
              Array.Copy(sumS, buf, upper + 1);

              foreach (var d in lms)
              {
                  if (d == n) continue;
                  sa[buf[s[d]]++] = d;
              }

              Array.Copy(sumL, buf, upper + 1);
              sa[buf[s[n - 1]]++] = n - 1;
              for (int i = 0; i < n; i++)
              {
                  int v = sa[i];
                  if (v >= 1 && !ls[v - 1])
                  {
                      sa[buf[s[v - 1]]++] = v - 1;
                  }
              }

              Array.Copy(sumL, buf, upper + 1);

              for (int i = n - 1; i >= 0; i--)
              {
                  int v = sa[i];
                  if (v >= 1 && ls[v - 1])
                  {
                      sa[--buf[s[v - 1] + 1]] = v - 1;
                  }
              }
          };

            int[] lmsMap = new int[n + 1];
            for (int i = 0; i <= n; i++)
            {
                lmsMap[i] = -1;
            }

            int m = 0;
            for (int i = 1; i < n; i++)
            {
                if (!ls[i - 1] && ls[i])
                {
                    lmsMap[i] = m++;
                }
            }

            List<int> lmsL = new List<int>(m);
            for (int i = 1; i < n; i++)
            {
                if (!ls[i - 1] && ls[i])
                {
                    lmsL.Add(i);
                }
            }

            induce(lmsL);

            if (m != 0)
            {
                List<int> sortedLms = new List<int>(m);
                foreach (var v in sa)
                {
                    if (lmsMap[v] != -1) sortedLms.Add(v);
                }

                int[] recS = new int[m];

                int recUpper = 0;
                recS[lmsMap[sortedLms[0]]] = 0;
                for (int i = 1; i < m; i++)
                {
                    int l = sortedLms[i - 1], r = sortedLms[i];
                    int endL = (lmsMap[l] + 1 < m) ? lmsL[lmsMap[l] + 1] : n;
                    int endR = (lmsMap[r] + 1 < m) ? lmsL[lmsMap[r] + 1] : n;

                    bool same = true;

                    if (endL - l != endR - r)
                    {
                        same = false;
                    }
                    else
                    {
                        while (l < endL)
                        {
                            if (s[l] != s[r])
                            {
                                break;
                            }
                            l++;
                            r++;
                        }

                        if (l == n || s[l] != s[r]) same = false;
                    }

                    if (!same) recUpper++;
                    recS[lmsMap[sortedLms[i]]] = recUpper;
                }

                var recSa = SAIS(recS, recUpper);

                for (int i = 0; i < m; i++)
                {
                    sortedLms[i] = lmsL[recSa[i]];
                }

                induce(sortedLms);
            }
            return sa;
        }
        #endregion // SuffixArray

        #region LCPArray
        /// <summary>
        /// sのLCPArrayとして長さ n-1の配列を返す
        /// </summary>
        /// <remarks>
        /// <para>res[i]はs[sa[i],n), s[sa[i+1],n)のLongest Common Prefixの長さ</para>
        /// <para>O(n)</para>
        /// </remarks>
        /// <typeparam name="T"></typeparam>
        /// <param name="s"></param>
        /// <param name="sa"></param>
        /// <param name="cmp"></param>
        /// <returns></returns>
        public static int[] LCPArray<T>(T[] s, int[] sa, Comparison<T> cmp)
        {
            int n = s.Length;
            Debug.Assert(n >= 1);
            int[] rnk = new int[n];
            for (int i = 0; i < n; i++)
            {
                rnk[sa[i]] = i;
            }

            int[] lcp = new int[n - 1];
            int h = 0;
            for (int i = 0; i < n; i++)
            {
                if (h > 0) h--;
                if (rnk[i] == 0) continue;
                int j = sa[rnk[i] - 1];
                for (; j + h < n && i + h < n; h++)
                {
                    if (cmp(s[j + h], s[i + h]) != 0) break;
                }
                lcp[rnk[i] - 1] = h;
            }

            return lcp;
        }

        /// <summary>
        /// sのLCPArrayとして長さ n-1の配列を返す
        /// </summary>
        /// <remarks>
        /// <para>res[i]はs[sa[i],n), s[sa[i+1],n)のLongest Common Prefixの長さ</para>
        /// <para>O(n)</para>
        /// </remarks>
        /// <typeparam name="T"></typeparam>
        /// <param name="s"></param>
        /// <param name="sa"></param>
        /// <returns></returns>
        public static int[] LCPArray<T>(T[] s, int[] sa)
        {
            return LCPArray(s, sa, Comparer<T>.Default.Compare);
        }
        /// <summary>
        /// sのLCPArrayとして長さ n-1の配列を返す
        /// </summary>
        /// <remarks>
        /// <para>res[i]はs[sa[i],n), s[sa[i+1],n)のLongest Common Prefixの長さ</para>
        /// <para>O(n)</para>
        /// </remarks>
        /// <typeparam name="T"></typeparam>
        /// <param name="s"></param>
        /// <param name="sa"></param>
        /// <returns></returns>
        public static int[] LCPArray(string s, int[] sa)
        {
            //int n = s.Length;
            //int[] s2 = new int[n];
            //for (int i = 0; i < n; i++)
            //{
            //    s2[i] = s[i];
            //}
            return LCPArray(s.ToCharArray(), sa);
        }

        #endregion // LCPArray

        #region ZAlgorithm

        /// <summary>
        /// 長さnの配列sについて sと s[i,n)のLCPの長さを返す
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="s"></param>
        /// <param name="eq"></param>
        /// <returns></returns>
        public static int[] ZAlgorithm<T>(T[] s, EqualityComparer<T> eq)
        {
            int n = s.Length;
            if (n == 0) return new int[0];
            int[] z = new int[n];
            z[0] = 0;
            for (int i = 1, j = 0; i < n; i++)
            {
                ref int k = ref z[i];
                k = (j + z[j] <= i) ? 0 : Math.Min(j + z[j] - i, z[i - j]);
                while (i + k < n && eq.Equals(s[k], s[i + k])) k++;
                if (j + z[j] < i + z[i]) j = i;
            }
            z[0] = n;
            return z;
        }

        /// <summary>
        /// 長さnの配列sについて sと s[i,n)のLCPの長さを返す
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="s"></param>
        /// <returns></returns>
        public static int[] ZAlgorithm<T>(T[] s)
        {
            return ZAlgorithm(s, EqualityComparer<T>.Default);
        }

        /// <summary>
        /// 長さnの文字列sについて sと s[i,n)のLCPの長さを返す
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="s"></param>
        /// <returns></returns>
        public static int[] ZAlgorithm(string s)
        {
            return ZAlgorithm(s.ToCharArray());
        }

        #endregion
    }
}

// https://bitbucket.org/camypaper/complib
namespace CompLib.Mathematics
{
    #region ModInt
    /// <summary>
    /// [0,<see cref="Mod"/>) までの値を取るような数
    /// </summary>
    public struct ModInt
    {
        /// <summary>
        /// 剰余を取る値．
        /// </summary>
        public const long Mod = (int)1e9 + 7;
        // public const long Mod = 998244353;

        /// <summary>
        /// 実際の数値．
        /// </summary>
        public long num;
        /// <summary>
        /// 値が <paramref name="n"/> であるようなインスタンスを構築します．
        /// </summary>
        /// <param name="n">インスタンスが持つ値</param>
        /// <remarks>パフォーマンスの問題上，コンストラクタ内では剰余を取りません．そのため，<paramref name="n"/> ∈ [0,<see cref="Mod"/>) を満たすような <paramref name="n"/> を渡してください．このコンストラクタは O(1) で実行されます．</remarks>
        public ModInt(long n) { num = n; }
        /// <summary>
        /// このインスタンスの数値を文字列に変換します．
        /// </summary>
        /// <returns>[0,<see cref="Mod"/>) の範囲内の整数を 10 進表記したもの．</returns>
        public override string ToString() { return num.ToString(); }
        public static ModInt operator +(ModInt l, ModInt r) { l.num += r.num; if (l.num >= Mod) l.num -= Mod; return l; }
        public static ModInt operator -(ModInt l, ModInt r) { l.num -= r.num; if (l.num < 0) l.num += Mod; return l; }
        public static ModInt operator *(ModInt l, ModInt r) { return new ModInt(l.num * r.num % Mod); }
        public static implicit operator ModInt(long n) { n %= Mod; if (n < 0) n += Mod; return new ModInt(n); }

        /// <summary>
        /// 与えられた 2 つの数値からべき剰余を計算します．
        /// </summary>
        /// <param name="v">べき乗の底</param>
        /// <param name="k">べき指数</param>
        /// <returns>繰り返し二乗法により O(N log N) で実行されます．</returns>
        public static ModInt Pow(ModInt v, long k) { return Pow(v.num, k); }

        /// <summary>
        /// 与えられた 2 つの数値からべき剰余を計算します．
        /// </summary>
        /// <param name="v">べき乗の底</param>
        /// <param name="k">べき指数</param>
        /// <returns>繰り返し二乗法により O(N log N) で実行されます．</returns>
        public static ModInt Pow(long v, long k)
        {
            long ret = 1;
            for (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)
                if ((k & 1) == 1) ret = ret * v % Mod;
            return new ModInt(ret);
        }
        /// <summary>
        /// 与えられた数の逆元を計算します．
        /// </summary>
        /// <param name="v">逆元を取る対象となる数</param>
        /// <returns>逆元となるような値</returns>
        /// <remarks>法が素数であることを仮定して，フェルマーの小定理に従って逆元を O(log N) で計算します．</remarks>
        public static ModInt Inverse(ModInt v) { return Pow(v, Mod - 2); }
    }
    #endregion
    #region Binomial Coefficient
    public class BinomialCoefficient
    {
        public ModInt[] fact, ifact;
        public BinomialCoefficient(int n)
        {
            fact = new ModInt[n + 1];
            ifact = new ModInt[n + 1];
            fact[0] = 1;
            for (int i = 1; i <= n; i++)
                fact[i] = fact[i - 1] * i;
            ifact[n] = ModInt.Inverse(fact[n]);
            for (int i = n - 1; i >= 0; i--)
                ifact[i] = ifact[i + 1] * (i + 1);
            ifact[0] = ifact[1];
        }
        public ModInt this[int n, int r]
        {
            get
            {
                if (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;
                return fact[n] * ifact[n - r] * ifact[r];
            }
        }
        public ModInt RepeatedCombination(int n, int k)
        {
            if (k == 0) return 1;
            return this[n + k - 1, k];
        }
    }
    #endregion
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

                _line = s.Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public string ReadLine()
        {
            _index = _line.Length;
            return Console.ReadLine();
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            string s = Console.ReadLine();
            _line = s.Length == 0 ? new string[0] : s.Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


// using a C# contest template, relevant code is at the bottom in the Run() function

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

class ProblemB {
    static string inputFileName = "../../input.txt";
    static StreamReader fileReader;
    static string[] inputTokens;
    static int curInputTokenIndex;
    static bool isLocal = Type.GetType("HaitaoLocal") != null;
    static string NextToken() {
        string ret = "";
        while (ret == "") {
            if (inputTokens == null || curInputTokenIndex >= inputTokens.Length) {
                string line;
                if (isLocal) {
                    line = fileReader.ReadLine();
                    if (line == null) {
                        throw new Exception("Error: out of input tokens!");
                    }
                } else {
                    line = Console.ReadLine();
                }
                inputTokens = line.Split();
                curInputTokenIndex = 0;
            }
            ret = inputTokens[curInputTokenIndex++];
        }
        return ret;
    }
    static int ri { get { return RI(); } }
    static string rs { get { return RS(); } }
    static long rl { get { return RL(); } }
    static double rd { get { return RD(); } }
    static int RI() {
        return Int32.Parse(NextToken());
    }
    static string RS() {
        return NextToken();
    }
    static long RL() {
        return Int64.Parse(NextToken());
    }
    static double RD() {
        return Double.Parse(NextToken());
    }
    static int[] RIA(int length) {
        int[] ret = new int[length];
        for (int i = 0; i < length; i++) {
            ret[i] = RI();
        }
        return ret;
    }
    static string[] RSA(int length) {
        string[] ret = new string[length];
        for (int i = 0; i < length; i++) {
            ret[i] = RS();
        }
        return ret;
    }
    static long[] RLA(int length) {
        long[] ret = new long[length];
        for (int i = 0; i < length; i++) {
            ret[i] = RL();
        }
        return ret;
    }
    static double[] RDA(int length) {
        double[] ret = new double[length];
        for (int i = 0; i < length; i++) {
            ret[i] = RD();
        }
        return ret;
    }
    static StringBuilder outputBuilder;
    static CultureInfo outputCulture = new CultureInfo("en-US");
    static void Out(object obj) {
        Type type = obj.GetType();
        string str = obj.ToString();
        if (type == typeof(double) || type == typeof(float)) {
            str = ((double)obj).ToString(outputCulture);
        }
        outputBuilder.Append(str + " ");
    }
    static void Outl() {
        Outl("");
    }
    static void Outl(object obj) {
        Out(obj);
        outputBuilder.Append("\n");
    }
    static void Flush() {
        if (isLocal) {
            ConsoleColor t = Console.ForegroundColor;
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine();
            Console.WriteLine(outputBuilder.ToString());
            Console.ForegroundColor = t;
        } else {
            Console.WriteLine(outputBuilder.ToString());
        }
        outputBuilder = new StringBuilder();
    }
    static void Log(string label, object obj) {
        if (!isLocal) return;

        ConsoleColor t = Console.ForegroundColor;
        Console.ForegroundColor = ConsoleColor.Gray;
        Console.Write(label + ": ");
        Console.ForegroundColor = t;
        Log(obj);
    }
    static void Log(object obj) {
        if (!isLocal) return;

        ConsoleColor t = Console.ForegroundColor;
        Console.ForegroundColor = ConsoleColor.White;
        Console.WriteLine(ToStringRecursive(obj));
        Console.ForegroundColor = t;
    }
    static string ToStringRecursive(object obj) {
        StringBuilder sb = new StringBuilder();
        if (!(obj is string) && (obj is System.Collections.IEnumerable)) {
            System.Collections.IEnumerable en = obj as System.Collections.IEnumerable;
            sb.Append("{");
            bool first = true;
            foreach (object el in en) {
                if (!first) sb.Append(", ");
                sb.Append(ToStringRecursive(el));
                first = false;
            }
            sb.Append("}");
            return sb.ToString();
        }
        return obj.ToString();
    }

    public static void Main(string[] args) {
        long startTick = 0;
        if (isLocal) {
            startTick = Environment.TickCount;
            fileReader = new StreamReader(inputFileName);
        }

        outputBuilder = new StringBuilder();
        Run();
        if (isLocal) {
            ConsoleColor t = Console.ForegroundColor;
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine();
            Console.WriteLine(outputBuilder.ToString());
            Console.WriteLine();
            Console.ForegroundColor = t;
        } else {
            Console.WriteLine(outputBuilder.ToString());
        }

        if (isLocal) {
            long runTime = Environment.TickCount - startTick;
            if (runTime > 32) {
                Log("time", runTime);
                Log("");
            }
        }
    }

    static void Run() {
        while (true) {
            int N = ri;
            int M = ri;
            if (N == 0 && M == 0) break;
            List<Point> boxes = new List<Point>(M);
            for (int i = 0; i < M; i++) {
                Point p = new Point(ri, ri);
                boxes.Add(p);
            }
            List<Point> hull = GrahamScanCompute(boxes);

            foreach (Point p in hull) {
                Log(p.x + " " + p.y);
            }

            List<Point> ans = new List<Point>();
            int cx = hull[0].x;
            int cy = hull[0].y;
            ans.Add(new Point(cx, cy));
            int ci = 1;
            for (; ci < hull.Count; ci++) {
                Log("a " + ci);
                int x = hull[ci].x;
                int y = hull[ci].y;
                if (y == cy) {
                    if (x > cx + 1) {
                        ans.Add(new Point(x - 1, y));
                    }
                    cx = x;
                    cy = y;
                    ci++;
                    break;
                }
                cx = x;
                cy = y;
                ans.Add(new Point(x, y));
            }
            for (; ci < hull.Count; ci++) {
                Log("b " + ci);
                int x = hull[ci].x;
                int y = hull[ci].y;
                if (x == cx) {
                    if (y > cy + 1) {
                        ans.Add(new Point(x - 1, y - 1));
                    }
                    cx = x;
                    cy = y;
                    ci++;
                    break;
                }
                cx = x;
                cy = y;
                ans.Add(new Point(x - 1, y));
            }
            for (; ci < hull.Count; ci++) {
                Log("c " + ci);
                int x = hull[ci].x;
                int y = hull[ci].y;
                if (y == cy) {
                    if (x < cx - 1) {
                        ans.Add(new Point(x, y - 1));
                    }
                    cx = x;
                    cy = y;
                    ci++;
                    break;
                }
                cx = x;
                cy = y;
                ans.Add(new Point(x - 1, y - 1));
            }
            for (; ci < hull.Count; ci++) {
                Log("d " + ci);
                int x = hull[ci].x;
                int y = hull[ci].y;
                if (x == cx) {
                    if (y < cy - 1) {
                        ans.Add(new Point(x, y));
                    }
                    cx = x;
                    cy = y;
                    ci++;
                    break;
                }
                cx = x;
                cy = y;
                ans.Add(new Point(x, y - 1));
            }
            for (; ci < hull.Count; ci++) {
                Log("e " + ci);
                int x = hull[ci].x;
                int y = hull[ci].y;
                cx = x;
                cy = y;
                ans.Add(new Point(x, y));
            }
            while (ans[ans.Count - 1].x == ans[0].x && ans[ans.Count - 1].y == ans[0].y) {
                ans.RemoveAt(ans.Count - 1);
            }

            Outl(ans.Count);
            foreach (Point p in ans) {
                Outl(p.x + " " + p.y);
            }
        }
    }

    // credit: http://stackoverflow.com/questions/25190164/graham-scan-issue-at-high-amount-of-points/25204997#25204997
    public static List<Point> GrahamScanCompute(IList<Point> initialPoints) {
        if (initialPoints.Count < 2)
            return initialPoints.ToList();

        // Find point with minimum y; if more than one, minimize x also.
        int iMin = Enumerable.Range(0, initialPoints.Count).Aggregate((jMin, jCur) => {
            if (initialPoints[jCur].y < initialPoints[jMin].y)
                return jCur;
            if (initialPoints[jCur].y > initialPoints[jMin].y)
                return jMin;
            if (initialPoints[jCur].x < initialPoints[jMin].x)
                return jCur;
            return jMin;
        });
        // Sort them by polar angle from iMin,
        var sortQuery = Enumerable.Range(0, initialPoints.Count)
            .Where((i) => (i != iMin)) // Skip the min point
            .Select((i) => new KeyValuePair<double, Point>(Math.Atan2(initialPoints[i].y - initialPoints[iMin].y, initialPoints[i].x - initialPoints[iMin].x), initialPoints[i]))
            .OrderBy((pair) => pair.Key)
            .Select((pair) => pair.Value);
        List<Point> points = new List<Point>(initialPoints.Count);
        points.Add(initialPoints[iMin]);     // Add minimum point
        points.AddRange(sortQuery);          // Add the sorted points.

        int M = 0;
        for (int i = 1, N = points.Count; i < N; i++) {
            bool keepNewPoint = true;
            if (M == 0) {
                // Find at least one point not coincident with points[0]
                keepNewPoint = !NearlyEqual(points[0], points[i]);
            } else {
                while (true) {
                    var flag = WhichToRemoveFromBoundary(points[M - 1], points[M], points[i]);
                    if (flag == RemovalFlag.None)
                        break;
                    else if (flag == RemovalFlag.MidPoint) {
                        if (M > 0)
                            M--;
                        if (M == 0)
                            break;
                    } else if (flag == RemovalFlag.EndPoint) {
                        keepNewPoint = false;
                        break;
                    } else
                        throw new Exception("Unknown RemovalFlag");
                }
            }
            if (keepNewPoint) {
                M++;
                Swap(points, M, i);
            }
        }
        // points[M] is now the last point in the boundary.  Remove the remainder.
        points.RemoveRange(M + 1, points.Count - M - 1);
        return points;
    }

    static void Swap<T>(IList<T> list, int i, int j) {
        if (i != j) {
            T temp = list[i];
            list[i] = list[j];
            list[j] = temp;
        }
    }

    public static double RelativeTolerance { get { return 1e-10; } }

    public static bool NearlyEqual(Point a, Point b) {
        return NearlyEqual(a.x, b.x) && NearlyEqual(a.y, b.y);
    }

    public static bool NearlyEqual(double a, double b) {
        return NearlyEqual(a, b, RelativeTolerance);
    }

    public static bool NearlyEqual(double a, double b, double epsilon) {
        // See here: http://floating-point-gui.de/errors/comparison/
        if (a == b) { // shortcut, handles infinities
            return true;
        }

        double absA = Math.Abs(a);
        double absB = Math.Abs(b);
        double diff = Math.Abs(a - b);
        double sum = absA + absB;
        if (diff < 4 * double.Epsilon || sum < 4 * double.Epsilon)
            // a or b is zero or both are extremely close to it
            // relative error is less meaningful here
            return true;

        // use relative error
        return diff / (absA + absB) < epsilon;
    }

    static double CCW(Point p1, Point p2, Point p3) {
        // Compute (p2 - p1) X (p3 - p1)
        double cross1 = (p2.x - p1.x) * (p3.y - p1.y);
        double cross2 = (p2.y - p1.y) * (p3.x - p1.x);
        if (NearlyEqual(cross1, cross2))
            return 0;
        return cross1 - cross2;
    }

    enum RemovalFlag {
        None,
        MidPoint,
        EndPoint
    };

    static RemovalFlag WhichToRemoveFromBoundary(Point p1, Point p2, Point p3) {
        var cross = CCW(p1, p2, p3);
        if (cross < 0)
            // Remove p2
            return RemovalFlag.MidPoint;
        if (cross > 0)
            // Remove none.
            return RemovalFlag.None;
        // Check for being reversed using the dot product off the difference vectors.
        var dotp = (p3.x - p2.x) * (p2.x - p1.x) + (p3.y - p2.y) * (p2.y - p1.y);
        if (NearlyEqual(dotp, 0.0))
            // Remove p2
            return RemovalFlag.MidPoint;
        if (dotp < 0)
            // Remove p3
            return RemovalFlag.EndPoint;
        else
            // Remove p2
            return RemovalFlag.MidPoint;
    }
}

class Point {
    public int x;
    public int y;
    public Point(int X, int Y) {
        this.y = X;
        this.x = Y;
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zaddda
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int[] b = Console.ReadLine().Split().Select(int.Parse).ToArray();
            bool c = true;
            for(int i = 1; i < a; ++i)
            {
                if(b[i-1]-b[i] > 1 || b[i] - b[i-1] > 1)
                {
                    c = false;
                    break;
                }
            }
            if (c)
            {
                Console.WriteLine("YES");
            }
            else Console.WriteLine("NO");
        }
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Heidi_and_Library__easy_
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();
            int k = Next();

            var nn = new int[n];
            for (int i = 0; i < n; i++)
            {
                nn[i] = Next();
            }

            var near = new int[n];
            var last = new int[n + 1];

            for (int i = 0; i < last.Length; i++)
            {
                last[i] = n;
            }

            for (int i = n - 1; i >= 0; i--)
            {
                near[i] = last[nn[i]];
                last[nn[i]] = i;
            }

            int count = 0;
            var heap = new MaxBinaryHeapObject<Point>(new Point());
            var f = new bool[n + 1];
            for (int i = 0; i < nn.Length; i++)
            {
                if (k <= 0 && !f[nn[i]])
                {
                    remove:
                    var t = heap.GetMax();
                    if (!f[t.index])
                    {
                        goto remove;
                    }

                    f[t.index] = false;
                }

                if (!f[nn[i]])
                {
                    count++;
                    f[nn[i]] = true;
                    k--;
                }
                heap.Add(new Point {index = nn[i], near = near[i]});
            }

            writer.WriteLine(count);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }

        #region Nested type: MaxBinaryHeapObject

        public class MaxBinaryHeapObject<T>
        {
            private readonly IComparer<T> _comparer;
            private readonly List<T> _list;

            public MaxBinaryHeapObject(IComparer<T> comparer)
            {
                _comparer = comparer ?? Comparer<T>.Default;
                _list = new List<T>();
            }

            public int HeapSize
            {
                get { return _list.Count; }
            }

            public void Add(T value)
            {
                _list.Add(value);
                int i = HeapSize - 1;
                int parent = (i - 1)/2;

                while (i > 0 && _comparer.Compare(_list[parent], _list[i]) == -1)
                {
                    T temp = _list[i];
                    _list[i] = _list[parent];
                    _list[parent] = temp;

                    i = parent;
                    parent = (i - 1)/2;
                }
            }

            public void Heapify(int i)
            {
                for (;;)
                {
                    int leftChild = 2*i + 1;
                    int rightChild = 2*i + 2;
                    int largestChild = i;

                    if (leftChild < HeapSize && _comparer.Compare(_list[leftChild], _list[largestChild]) == 1)
                    {
                        largestChild = leftChild;
                    }

                    if (rightChild < HeapSize && _comparer.Compare(_list[rightChild], _list[largestChild]) == 1)
                    {
                        largestChild = rightChild;
                    }

                    if (largestChild == i)
                    {
                        break;
                    }

                    T temp = _list[i];
                    _list[i] = _list[largestChild];
                    _list[largestChild] = temp;
                    i = largestChild;
                }
            }

            public T Max()
            {
                return _list[0];
            }

            public T GetMax()
            {
                T result = _list[0];
                _list[0] = _list[HeapSize - 1];
                _list.RemoveAt(HeapSize - 1);
                Heapify(0);
                return result;
            }
        }

        #endregion

        #region Nested type: Point

        private class Point : IComparer<Point>
        {
            public int index;
            public int near;

            #region IComparer<Point> Members

            public int Compare(Point x, Point y)
            {
                return x.near.CompareTo(y.near);
            }

            #endregion
        }

        #endregion
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
//using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

//using System.Threading;

namespace ReadWriteTemplate
{
    public static class Solver
    {
        private static void SolveCase()
        {
            int n = ReadInt();
            int k = ReadInt();
            int[] a = ReadIntArray();

            Queue<int>[] queues = new Queue<int>[n + 1];
            for (int i = 0; i < n + 1; i++)
            {
                queues[i] = new Queue<int>();
            }
            for (int i = 0; i < n; i++)
            {
                queues[a[i]].Enqueue(i);
            }

            int ans = 0;
            RedBlackTree<int> tree = new RedBlackTree<int>();
            RedBlackNode<int>[] nodes = new RedBlackNode<int>[n + 1];
            for (int i = 0; i < n; i++)
            {
                int book = a[i];

                queues[book].Dequeue();
                int nextTime = int.MaxValue;
                if (queues[book].Count > 0)
                {
                    nextTime = queues[book].Peek();
                }

                var current = nodes[book];
                if (current == null)
                {
                    if (tree.Count == k)
                    {
                        var max = tree.Maximum();
                        tree.Delete(max);
                        nodes[max.Value] = null;
                    }
                    nodes[book] = new RedBlackNode<int>(nextTime, book);
                    tree.Insert(nodes[book]);
                    ans++;
                }
                else
                {
                    tree.Delete(current);
                    nodes[book] = new RedBlackNode<int>(nextTime, book);
                    tree.Insert(nodes[book]);
                }
            }

            Writer.WriteLine(ans);
        }

        /*public class Book
        {
            public int Id;

            public int Key;
        }*/

        public class RedBlackTree<T>
        {
            private readonly RedBlackNode<T> NULL = new RedBlackNode<T>(0, default(T));

            public RedBlackNode<T> Root { get; set; }

            public int Count { get; private set; }

            public RedBlackTree()
            {
                Root = NULL;
            }

            public List<RedBlackNode<T>> InorderTreeWalk()
            {
                List<RedBlackNode<T>> nodes = new List<RedBlackNode<T>>();
                InorderTreeWalk(Root, nodes);
                return nodes;
            }

            public void InorderTreeWalk(RedBlackNode<T> node, List<RedBlackNode<T>> nodes)
            {
                if (node != NULL)
                {
                    InorderTreeWalk(node.Left, nodes);
                    nodes.Add(node);
                    InorderTreeWalk(node.Right, nodes);
                }
            }

            public RedBlackNode<T> Search(int key)
            {
                RedBlackNode<T> node = Search(Root, key);
                return node == NULL ? null : node;
            }

            public RedBlackNode<T> Search(RedBlackNode<T> node, int key)
            {
                while (node != NULL && node.Key != key)
                {
                    node = key < node.Key ? node.Left : node.Right;
                }
                return node;
            }

            public RedBlackNode<T> Minimum()
            {
                RedBlackNode<T> node = Minimum(Root);
                return node == NULL ? null : node;
            }

            public RedBlackNode<T> Minimum(RedBlackNode<T> node)
            {
                while (node != NULL && node.Left != NULL)
                {
                    node = node.Left;
                }
                return node;
            }

            public RedBlackNode<T> Maximum()
            {
                RedBlackNode<T> node = Maximum(Root);
                return node == NULL ? null : node;
            }

            public RedBlackNode<T> Maximum(RedBlackNode<T> node)
            {
                while (node != NULL && node.Right != NULL)
                {
                    node = node.Right;
                }
                return node;
            }

            public RedBlackNode<T> Successor(RedBlackNode<T> node)
            {
                if (node.Right != NULL)
                {
                    return Minimum(node.Right);
                }
                RedBlackNode<T> parent = node.Parent;
                while (parent != NULL && node == parent.Right)
                {
                    node = parent;
                    parent = node.Parent;
                }
                return parent;
            }

            public RedBlackNode<T> Predecessor(RedBlackNode<T> node)
            {
                if (node.Left != NULL)
                {
                    return Maximum(node.Left);
                }
                RedBlackNode<T> parent = node.Parent;
                while (parent != NULL && node == parent.Left)
                {
                    node = parent;
                    parent = node.Parent;
                }
                return parent;
            }

            public void Insert(int key, T value)
            {
                Insert(new RedBlackNode<T>(key, value));
            }

            public void Insert(RedBlackNode<T> newNode)
            {
                RedBlackNode<T> parent = NULL;
                RedBlackNode<T> node = Root;
                while (node != NULL)
                {
                    parent = node;
                    node = newNode.Key < node.Key ? node.Left : node.Right;
                }
                newNode.Parent = parent;
                if (parent == NULL)
                {
                    Root = newNode;
                }
                else if (newNode.Key < parent.Key)
                {
                    parent.Left = newNode;
                }
                else
                {
                    parent.Right = newNode;
                }
                newNode.Left = NULL;
                newNode.Right = NULL;
                newNode.Color = Color.Red;
                RedBlackInsertFixup(newNode);

                Count++;
            }

            private void RedBlackInsertFixup(RedBlackNode<T> z)
            {
                while (z.Parent.Color == Color.Red)
                {
                    if (z.Parent == z.Parent.Parent.Left)
                    {
                        var y = z.Parent.Parent.Right;
                        if (y.Color == Color.Red)
                        {
                            z.Parent.Color = Color.Black;
                            y.Color = Color.Black;
                            z.Parent.Parent.Color = Color.Red;
                            z = z.Parent.Parent;
                        }
                        else
                        {
                            if (z == z.Parent.Right)
                            {
                                z = z.Parent;
                                LeftRotate(z);
                            }
                            z.Parent.Color = Color.Black;
                            z.Parent.Parent.Color = Color.Red;
                            RightRotate(z.Parent.Parent);
                        }
                    }
                    else
                    {
                        var y = z.Parent.Parent.Left;
                        if (y.Color == Color.Red)
                        {
                            z.Parent.Color = Color.Black;
                            y.Color = Color.Black;
                            z.Parent.Parent.Color = Color.Red;
                            z = z.Parent.Parent;
                        }
                        else
                        {
                            if (z == z.Parent.Left)
                            {
                                z = z.Parent;
                                RightRotate(z);
                            }
                            z.Parent.Color = Color.Black;
                            z.Parent.Parent.Color = Color.Red;
                            LeftRotate(z.Parent.Parent);
                        }
                    }
                }
                Root.Color = Color.Black;
            }

            private void LeftRotate(RedBlackNode<T> x)
            {
                RedBlackNode<T> y = x.Right;
                x.Right = y.Left;
                if (y.Left != NULL)
                {
                    y.Left.Parent = x;
                }
                y.Parent = x.Parent;
                if (x.Parent == NULL)
                {
                    Root = y;
                }
                else if (x == x.Parent.Left)
                {
                    x.Parent.Left = y;
                }
                else
                {
                    x.Parent.Right = y;
                }
                y.Left = x;
                x.Parent = y;
            }

            private void RightRotate(RedBlackNode<T> x)
            {
                RedBlackNode<T> y = x.Left;
                x.Left = y.Right;
                if (y.Right != NULL)
                {
                    y.Right.Parent = x;
                }
                y.Parent = x.Parent;
                if (x.Parent == NULL)
                {
                    Root = y;
                }
                else if (x == x.Parent.Right)
                {
                    x.Parent.Right = y;
                }
                else
                {
                    x.Parent.Left = y;
                }
                y.Right = x;
                x.Parent = y;
            }

            public void Delete(int key)
            {
                RedBlackNode<T> node = Search(key);
                if (node != NULL && node != null)
                {
                    Delete(node);
                }
            }

            public void Delete(RedBlackNode<T> z)
            {
                var y = z;
                var yOriginalColor = y.Color;
                RedBlackNode<T> x;
                if (z.Left == NULL)
                {
                    x = z.Right;
                    Transplant(z, z.Right);
                }
                else if (z.Right == NULL)
                {
                    x = z.Left;
                    Transplant(z, z.Left);
                }
                else
                {
                    y = Minimum(z.Right);
                    yOriginalColor = y.Color;
                    x = y.Right;
                    if (y.Parent == z)
                    {
                        x.Parent = y;
                    }
                    else
                    {
                        Transplant(y, y.Right);
                        y.Right = z.Right;
                        y.Right.Parent = y;
                    }
                    Transplant(z, y);
                    y.Left = z.Left;
                    y.Left.Parent = y;
                    y.Color = z.Color;
                }
                if (yOriginalColor == Color.Black)
                {
                    DeleteFixup(x);
                }

                Count--;
            }

            private void DeleteFixup(RedBlackNode<T> x)
            {
                while (x != Root && x.Color == Color.Black)
                {
                    if (x == x.Parent.Left)
                    {
                        var w = x.Parent.Right;
                        if (w.Color == Color.Red)
                        {
                            w.Color = Color.Black;
                            x.Parent.Color = Color.Red;
                            LeftRotate(x.Parent);
                            w = x.Parent.Right;
                        }
                        if (w.Left.Color == Color.Black && w.Right.Color == Color.Black)
                        {
                            w.Color = Color.Red;
                            x = x.Parent;
                        }
                        else
                        {
                            if (w.Right.Color == Color.Black)
                            {
                                w.Left.Color = Color.Black;
                                w.Color = Color.Red;
                                RightRotate(w);
                                w = x.Parent.Right;
                            }
                            w.Color = x.Parent.Color;
                            x.Parent.Color = Color.Black;
                            w.Right.Color = Color.Black;
                            LeftRotate(x.Parent);
                            x = Root;
                        }
                    }
                    else
                    {
                        var w = x.Parent.Left;
                        if (w.Color == Color.Red)
                        {
                            w.Color = Color.Black;
                            x.Parent.Color = Color.Red;
                            RightRotate(x.Parent);
                            w = x.Parent.Left;
                        }
                        if (w.Right.Color == Color.Black && w.Left.Color == Color.Black)
                        {
                            w.Color = Color.Red;
                            x = x.Parent;
                        }
                        else
                        {
                            if (w.Left.Color == Color.Black)
                            {
                                w.Right.Color = Color.Black;
                                w.Color = Color.Red;
                                LeftRotate(w);
                                w = x.Parent.Left;
                            }
                            w.Color = x.Parent.Color;
                            x.Parent.Color = Color.Black;
                            w.Left.Color = Color.Black;
                            RightRotate(x.Parent);
                            x = Root;
                        }
                    }
                }
                x.Color = Color.Black;
            }

            private void Transplant(RedBlackNode<T> u, RedBlackNode<T> v)
            {
                if (u.Parent == NULL)
                {
                    Root = v;
                }
                else if (u == u.Parent.Left)
                {
                    u.Parent.Left = v;
                }
                else
                {
                    u.Parent.Right = v;
                }

                v.Parent = u.Parent;
            }

            private int? BlackHeight;

            public void Validate()
            {
                BlackHeight = null;
                if (Root.Color != Color.Black)
                {
                    throw new InvalidOperationException("Root is not black.");
                }
                Validate(Root, 0);
            }

            private void Validate(RedBlackNode<T> node, int height)
            {
                if (node == NULL)
                {
                    if (BlackHeight == null)
                    {
                        BlackHeight = height;
                    }
                    else
                    {
                        if (BlackHeight != height)
                        {
                            string message = string.Format("Black heights are not equal: {0} and {1}.", BlackHeight, height);
                            throw new InvalidOperationException(message);
                        }
                    }
                    return;
                }

                if (node.Color == Color.Black)
                {
                    height++;
                }
                else
                {
                    if (node.Left.Color != Color.Black || node.Right.Color != Color.Black)
                    {
                        throw new InvalidOperationException("Children of red node are not black.");
                    }
                }

                Validate(node.Left, height);
                Validate(node.Right, height);
            }
        }

        public class RedBlackNode<T>
        {
            public RedBlackNode(int key, T value)
            {
                Key = key;
                Value = value;
            }

            public int Key { get; set; }

            public T Value { get; set; }

            public RedBlackNode<T> Parent { get; set; }

            public RedBlackNode<T> Left { get; set; }

            public RedBlackNode<T> Right { get; set; }

            public bool Color { get; set; }
        }

        public class Color
        {
            public const bool Red = true;

            public const bool Black = false;
        }

        public static void Solve()
        {
            //int T = ReadInt();
            //for (int i = 0; i < T; i++)
            {
                //Writer.Write("Case #{0}: ", i + 1);
                SolveCase();
            }
        }

        public class Point
        {
            public Point(int x, int y)
            {
                X = x;
                Y = y;
            }

            public int X;

            public int Y;

            protected bool Equals(Point other)
            {
                return X == other.X && Y == other.Y;
            }

            public override bool Equals(object obj)
            {
                if (ReferenceEquals(null, obj))
                {
                    return false;
                }
                if (ReferenceEquals(this, obj))
                {
                    return true;
                }
                if (obj.GetType() != this.GetType())
                {
                    return false;
                }
                return Equals((Point) obj);
            }

            public override int GetHashCode()
            {
                unchecked
                {
                    return (X * 397) ^ Y;
                }
            }
        }

        public static class Standard
        {
            public static long Power(long x, long p, long mod)
            {
                long result = 1;
                while (p > 0)
                {
                    if ((p & 1) == 0)
                    {
                        x = (x * x) % mod;
                        p >>= 1;
                    }
                    else
                    {
                        result = (result * x) % mod;
                        p--;
                    }
                }
                return result;
            }

            public static long Gcd(long a, long b)
            {
                return b == 0 ? a : Gcd(b, a % b);
            }

            public static List<int> GetPrimes(int n)
            {
                bool[] isPrime = Enumerable.Repeat(true, n).ToArray();
                isPrime[0] = false;
                isPrime[1] = false;
                for (int i = 2; i < n; i++)
                {
                    if (isPrime[i])
                    {
                        for (int j = i + i; j < n; j += i)
                        {
                            isPrime[j] = false;
                        }
                    }
                }
                List<int> primes = new List<int>();
                for (int i = 0; i < n; i++)
                {
                    if (isPrime[i])
                    {
                        primes.Add(i);
                    }
                }
                return primes;
            }
        }

        public static void Main()
        {
            //Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

#if DEBUG
            //Reader = Console.In; Writer = Console.Out;
            Reader = File.OpenText("input.txt"); Writer = File.CreateText("output.txt");
#else
            Reader = Console.In; Writer = Console.Out;
#endif

            Solve();

            Reader.Close();
            Writer.Close();
        }

        public static IOrderedEnumerable<TSource> OrderByWithShuffle<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
        {
            return source.Shuffle().OrderBy(keySelector);
        }

        public static T[] Shuffle<T>(this IEnumerable<T> source)
        {
            T[] result = source.ToArray();
            Random rnd = new Random();
            for (int i = result.Length - 1; i >= 1; i--)
            {
                int k = rnd.Next(i + 1);
                T tmp = result[k];
                result[k] = result[i];
                result[i] = tmp;
            }
            return result;
        }

        #region Read/Write

        private static TextReader Reader;

        private static TextWriter Writer;

        private static Queue<string> CurrentLineTokens = new Queue<string>();

        private static string[] ReadAndSplitLine()
        {
            return Reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        public static string ReadToken()
        {
            while (CurrentLineTokens.Count == 0)
                CurrentLineTokens = new Queue<string>(ReadAndSplitLine());
            return CurrentLineTokens.Dequeue();
        }

        public static string ReadLine()
        {
            return Reader.ReadLine();
        }

        public static int ReadInt()
        {
            return int.Parse(ReadToken());
        }

        public static long ReadLong()
        {
            return long.Parse(ReadToken());
        }

        public static double ReadDouble()
        {
            return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
        }

        public static int[] ReadIntArray()
        {
            return ReadAndSplitLine().Select(int.Parse).ToArray();
        }

        public static long[] ReadLongArray()
        {
            return ReadAndSplitLine().Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
        }

        public static int[][] ReadIntMatrix(int numberOfRows)
        {
            int[][] matrix = new int[numberOfRows][];
            for (int i = 0; i < numberOfRows; i++)
                matrix[i] = ReadIntArray();
            return matrix;
        }

        public static string[] ReadLines(int quantity)
        {
            string[] lines = new string[quantity];
            for (int i = 0; i < quantity; i++)
                lines[i] = Reader.ReadLine().Trim();
            return lines;
        }

        public static void WriteArray<T>(IEnumerable<T> array)
        {
            Writer.WriteLine(string.Join(" ", array));
        }

        #endregion
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace Codeforces
{
	internal class Template
	{
		private void Solve()
		{
			var n = cin.NextInt();
			var k = cin.NextInt();
			var a = new int[n];
			var pos = new Queue<int>[n + 10];
			for (var i = 0; i < pos.Length; i++)
			{
				pos[i] = new Queue<int>();
			}
			for (var i = 0; i < n; i++)
			{
				a[i] = cin.NextInt();
				pos[a[i]].Enqueue(i);
			}
			var have = new HashSet<int>();
			var timesNeeded = new SortedDictionary<int, int>();
			var res = 0;
			for (var i = 0; i < a.Length; i++)
			{
				if (!have.Contains(a[i]))
				{
					if (have.Count == k)
					{
						var first = timesNeeded.First();
						timesNeeded.Remove(first.Key);
						have.Remove(first.Value);
					}
					have.Add(a[i]);
					if (i != pos[a[i]].Peek())
					{
						throw new AccessViolationException();
					}
					pos[a[i]].Dequeue();
					if (!pos[a[i]].Any())
					{
						timesNeeded.Add(-1000000000 + i, a[i]);
					}
					else
					{
						timesNeeded.Add(-pos[a[i]].Peek(), a[i]);
					}
					res++;
				}
				else
				{
					var p = pos[a[i]].Dequeue();
					timesNeeded.Remove(-p);
					if (!pos[a[i]].Any())
					{
						timesNeeded.Add(-1000000000 + i, a[i]);
					}
					else
					{
						timesNeeded.Add(-pos[a[i]].Peek(), a[i]);
					}
				}
			}
			Console.WriteLine(res);
		}

		private static readonly Scanner cin = new Scanner();

		private static void Main()
		{
#if DEBUG
			var inputText = File.ReadAllText(@"..\..\input.txt");
			var testCases = inputText.Split(new[] { "input" }, StringSplitOptions.RemoveEmptyEntries);
			var consoleOut = Console.Out;
			for (var i = 0; i < testCases.Length; i++)
			{
				var parts = testCases[i].Split(new[] { "output" }, StringSplitOptions.RemoveEmptyEntries);
				Console.SetIn(new StringReader(parts[0].Trim()));
				var stringWriter = new StringWriter();
				Console.SetOut(stringWriter);
				var sw = Stopwatch.StartNew();
				new Template().Solve();
				sw.Stop();
				var output = stringWriter.ToString();

				Console.SetOut(consoleOut);
				var color = ConsoleColor.Green;
				var status = "Passed";
				if (parts[1].Trim() != output.Trim())
				{
					color = ConsoleColor.Red;
					status = "Failed";
				}
				Console.ForegroundColor = color;
				Console.WriteLine("Test {0} {1} in {2}ms", i + 1, status, sw.ElapsedMilliseconds);
			}
			Console.ReadLine();
			Console.ReadKey();
#else
			new Template().Solve();
			Console.ReadLine();
#endif
		}
	}

	internal class Scanner
	{
		private string[] s = new string[0];
		private int i;
		private readonly char[] cs = { ' ' };

		public string NextString()
		{
			if (i < s.Length) return s[i++];
			var line = Console.ReadLine() ?? string.Empty;
			s = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			i = 1;
			return s.First();
		}

		public double NextDouble()
		{
			return double.Parse(NextString());
		}

		public int NextInt()
		{
			return int.Parse(NextString());
		}

		public long NextLong()
		{
			return long.Parse(NextString());
		}
	}
}


using System;
using System.Linq;
using System.Collections.Generic;
using Debug = System.Diagnostics.Debug;
using SB = System.Text.StringBuilder;
//using System.Numerics;
using Number = System.Int64;
using static System.Math;
//using static MathEx;
//using P = System.Collections.Generic.KeyValuePair<int, int>;
namespace Program
{
    public class Solver
    {
        public void Solve()
        {
            var n = ri;
            var k = ri;
            var a = Enumerate(n, x => ri - 1);
            var last = Enumerate(n, x => n + 1);
            var next = new int[n];
            for (int i = n - 1; i >= 0; i--)
            {
                next[i] = last[a[i]];
                last[a[i]] = i;
            }
            var cnt = 0;
            Debug.WriteLine(next.AsJoinedString());
            var s = new SortedSet<long>();
            var pq = new SortedSet<long>();
            for (int i = 0; i < n; i++)
            {
                Debug.WriteLine(s.AsJoinedString());
                if (s.Add(a[i]))
                {
                    cnt++;
                    pq.Add(next[i] * 1000000L + a[i]);
                    if (s.Count > k)
                    {
                        var ma = pq.Max;
                        pq.Remove(ma);
                        s.Remove(ma % 1000000L);
                    }
                }
            }
            IO.Printer.Out.WriteLine(cnt);

        }
        //*
        int ri => sc.Integer();
        long rl => sc.Long();
        double rd => sc.Double();
        string rs => sc.Scan();
        char rc => sc.Char();

        [System.Diagnostics.Conditional("DEBUG")]
        void put(params object[] a) => Debug.WriteLine(string.Join(" ", a));

        //*/
        public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());

        static T[] Enumerate<T>(int n, Func<int, T> f)
        {
            var a = new T[n];
            for (int i = 0; i < n; ++i) a[i] = f(i);
            return a;
        }
        static void Swap<T>(ref T a, ref T b)
        {
            var tmp = a;
            a = b;
            b = tmp;
        }
    }
}

#region main

static class Ex
{
    public static string AsString(this IEnumerable<char> ie)
    {
        return new string(ie.ToArray());
    }

    public static string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ")
    {
        return string.Join(st, ie);
    }

    public static void Main()
    {
        var solver = new Program.Solver();
        solver.Solve();
        Program.IO.Printer.Out.Flush();
    }
}

#endregion
#region Ex

namespace Program.IO
{
    using System.IO;
    using System.Text;
    using System.Globalization;

    public class Printer: StreamWriter
    {
        static Printer()
        {
            Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false };
        }

        public static Printer Out { get; set; }

        public override IFormatProvider FormatProvider
        {
            get { return CultureInfo.InvariantCulture; }
        }

        public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true))
        {
        }

        public Printer(Stream stream, Encoding encoding) : base(stream, encoding)
        {
        }

        public void Write<T>(string format, T[] source)
        {
            base.Write(format, source.OfType<object>().ToArray());
        }

        public void WriteLine<T>(string format, T[] source)
        {
            base.WriteLine(format, source.OfType<object>().ToArray());
        }
    }

    public class StreamScanner
    {
        public StreamScanner(Stream stream)
        {
            str = stream;
        }

        public readonly Stream str;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        public bool isEof;

        public bool IsEndOfStream
        {
            get { return isEof; }
        }

        private byte read()
        {
            if (isEof) return 0;
            if (ptr < len) return buf[ptr++];
            ptr = 0;
            if ((len = str.Read(buf, 0, 1024)) > 0) return buf[ptr++];
            isEof = true;
            return 0;
        }

        public char Char()
        {
            byte b;
            do b = read(); while ((b < 33 || 126 < b) && !isEof);
            return (char)b;
        }

        public string Scan()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b >= 33 && b <= 126; b = (char)read())
                sb.Append(b);
            return sb.ToString();
        }

        public string ScanLine()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b != '\n'; b = (char)read())
                if (b == 0) break;
                else if (b != '\r') sb.Append(b);
            return sb.ToString();
        }

        public long Long()
        {
            if (isEof) return long.MinValue;
            long ret = 0;
            byte b;
            var ng = false;
            do b = read(); while (b != 0 && b != '-' && (b < '0' || '9' < b));
            if (b == 0) return long.MinValue;
            if (b == '-')
            {
                ng = true;
                b = read();
            }
            for (; ; b = read())
            {
                if (b < '0' || '9' < b)
                    return ng ? -ret : ret;
                ret = ret * 10 + b - '0';
            }
        }

        public int Integer()
        {
            return (isEof) ? int.MinValue : (int)Long();
        }

        public double Double()
        {
            var s = Scan();
            return s != "" ? double.Parse(s, CultureInfo.InvariantCulture) : double.NaN;
        }

        static T[] enumerate<T>(int n, Func<T> f)
        {
            var a = new T[n];
            for (int i = 0; i < n; ++i) a[i] = f();
            return a;
        }

        public char[] Char(int n)
        {
            return enumerate(n, Char);
        }

        public string[] Scan(int n)
        {
            return enumerate(n, Scan);
        }

        public double[] Double(int n)
        {
            return enumerate(n, Double);
        }

        public int[] Integer(int n)
        {
            return enumerate(n, Integer);
        }

        public long[] Long(int n)
        {
            return enumerate(n, Long);
        }
    }
}

#endregion

#region BinaryHeap
public class PriorityQueue<T>
{
    readonly List<T> heap = new List<T>();
    readonly IComparer<T> cmp;
    public PriorityQueue() { cmp = Comparer<T>.Default; }
    public PriorityQueue(Comparison<T> f) { cmp = Comparer<T>.Create(f); }
    public PriorityQueue(IComparer<T> c) { cmp = c; }
    public void Enqueue(T item)
    {

        var i = heap.Count;
        heap.Add(item);
        while (i > 0)
        {
            var p = (i - 1) / 2;
            if (cmp.Compare(heap[p], item) <= 0)
                break;
            heap[i] = heap[p];
            i = p;
        }
        heap[i] = item;

    }
    public T Dequeue()
    {
        var ret = heap[0];
        var i = 0;
        var x = heap[heap.Count - 1];

        while ((i * 2) + 1 < heap.Count - 1)
        {
            var a = i * 2 + 1;
            var b = i * 2 + 2;
            if (b < heap.Count - 1 && cmp.Compare(heap[b], heap[a]) < 0) a = b;
            if (cmp.Compare(heap[a], x) >= 0)
                break;
            heap[i] = heap[a];
            i = a;
        }
        heap[i] = x;
        heap.RemoveAt(heap.Count - 1);
        return ret;

    }
    public T Peek() { return heap[0]; }
    public int Count { get { return heap.Count; } }
    public bool Any() { return heap.Count > 0; }
    public T[] Items
    {
        get
        {
            var ret = heap.ToArray();
            Array.Sort(ret, cmp);
            return ret;
        }
    }
}
#endregion


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    public void Solve()
    {
        int n = 11;
        var a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = ReadInt();

        double res = 0;
        for (int i = n - 1; i >= 0; i--)
        {
            res = Math.Sqrt(Math.Abs(a[i])) + Math.Pow(a[i], 3) * 5;
            writer.Write("f({0}) = ", a[i]);
            if (res > 400)
                Write("MAGNA NIMIS!");
            else
                Write(string.Format("{0:0.00}", res));
        }
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        //reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        //reader = new StreamReader("input.txt");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            new Solver().Solve();
            //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        catch (Exception ex)
        {
#if DEBUG
            Console.WriteLine(ex);
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write
    private static Queue<string> currentLineTokens = new Queue<string>();
    private static string[] ReadAndSplitLine() { return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries); }
    public static string ReadToken() { while (currentLineTokens.Count == 0)currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue(); }
    public static int ReadInt() { return int.Parse(ReadToken()); }
    public static long ReadLong() { return long.Parse(ReadToken()); }
    public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }
    public static int[] ReadIntArray() { return ReadAndSplitLine().Select(int.Parse).ToArray(); }
    public static long[] ReadLongArray() { return ReadAndSplitLine().Select(long.Parse).ToArray(); }
    public static double[] ReadDoubleArray() { return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray(); }
    public static int[][] ReadIntMatrix(int numberOfRows) { int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++)matrix[i] = ReadIntArray(); return matrix; }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++)ret[i][j] = matrix[j][i]; } return ret;
    }
    public static string[] ReadLines(int quantity) { string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++)lines[i] = reader.ReadLine().Trim(); return lines; }
    public static void WriteArray<T>(IEnumerable<T> array) { writer.WriteLine(string.Join(" ", array)); }
    public static void Write(params object[] array) { WriteArray(array); }
    public static void WriteLines<T>(IEnumerable<T> array) { foreach (var a in array)writer.WriteLine(a); }
    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }
    private static T[] Init<T>(int size) where T : new() { var ret = new T[size]; for (int i = 0; i < size; i++)ret[i] = new T(); return ret; }
    #endregion
}


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;

namespace ReadWriteTemplate
{
    public static class Solver
    {
        private static void SolveCase()
        {
            int n = ReadInt();
            int ans = 0;
            for (int i = 0; i < n - 2; i++)
            {
                ans += (i + 2) * (i + 3);
            }
            Writer.WriteLine(ans);
        }

        public static void Solve()
        {
#if DEBUG
            var sw = Stopwatch.StartNew();
#endif

            SolveCase();

            /*int T = ReadInt();
            for (int i = 0; i < T; i++)
            {
                // Writer.WriteLine("Case {0}:", i + 1);
                // Writer.Write("Case #{0}: ", i + 1);
                SolveCase();
            }*/

#if DEBUG
            sw.Stop();
            Console.WriteLine($"{sw.ElapsedMilliseconds} ms");
#endif
        }

        public static void Main()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

#if DEBUG
            // Reader = Console.In; Writer = Console.Out;
            Reader = File.OpenText("input.txt"); Writer = File.CreateText("output.txt");
#else
            Reader = Console.In; Writer = Console.Out;
#endif

            // Solve();
            Thread thread = new Thread(Solve, 64 * 1024 * 1024);
            thread.CurrentCulture = CultureInfo.InvariantCulture;
            thread.Start();
            thread.Join();

            Reader.Close();
            Writer.Close();
        }

        public static IOrderedEnumerable<TSource> OrderByWithShuffle<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
        {
            return source.Shuffle().OrderBy(keySelector);
        }

        public static T[] Shuffle<T>(this IEnumerable<T> source)
        {
            T[] result = source.ToArray();
            Random rnd = new Random();
            for (int i = result.Length - 1; i >= 1; i--)
            {
                int k = rnd.Next(i + 1);
                T tmp = result[k];
                result[k] = result[i];
                result[i] = tmp;
            }
            return result;
        }

        #region Read/Write

        private static TextReader Reader;

        private static TextWriter Writer;

        private static Queue<string> CurrentLineTokens = new Queue<string>();

        private static string[] ReadAndSplitLine()
        {
            return Reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        public static string ReadToken()
        {
            while (CurrentLineTokens.Count == 0)
                CurrentLineTokens = new Queue<string>(ReadAndSplitLine());
            return CurrentLineTokens.Dequeue();
        }

        public static string ReadLine()
        {
            return Reader.ReadLine();
        }

        public static int ReadInt()
        {
            return int.Parse(ReadToken());
        }

        public static long ReadLong()
        {
            return long.Parse(ReadToken());
        }

        public static double ReadDouble()
        {
            return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
        }

        public static int[] ReadIntArray()
        {
            return ReadAndSplitLine().Select(int.Parse).ToArray();
        }

        public static long[] ReadLongArray()
        {
            return ReadAndSplitLine().Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
        }

        public static int[][] ReadIntMatrix(int numberOfRows)
        {
            int[][] matrix = new int[numberOfRows][];
            for (int i = 0; i < numberOfRows; i++)
                matrix[i] = ReadIntArray();
            return matrix;
        }

        public static string[] ReadLines(int quantity)
        {
            string[] lines = new string[quantity];
            for (int i = 0; i < quantity; i++)
                lines[i] = Reader.ReadLine().Trim();
            return lines;
        }

        public static void WriteArray<T>(IEnumerable<T> array)
        {
            Writer.WriteLine(string.Join(" ", array));
        }

        #endregion
    }
}


using System;
using System.Linq;
using System.Globalization;

namespace _630
{
    class Program
    {
        static void Main()
        {
            var n = long.Parse(Console.ReadLine());
            var ans = n / 2 + n / 3 + n / 5 + n / 7 - n / 6 - n / 10 - n / 14 - n / 15 - n / 21 -
                n / 35 - n / 30 - n / 42 - n / 70 - n / 105 - n / 210;
            ans = n - ans;
            Console.WriteLine(ans);

        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

public class Solver
{
    public object Solve()
    {
        int n = ReadInt();
        ReadInt();
        ReadInt();
        var a = new HashSet<int>(ReadIntArray());

        WriteArray(Enumerable.Range(1, n).Select(i => a.Contains(i) ? 1 : 2));

        return null;
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = Console.In;
        writer = Console.Out;
#endif
        try
        {
            object result = new Solver().Solve();
            if (result != null)
            {
                writer.WriteLine(result);
            }
        }
        catch (Exception ex)
        {
#if DEBUG
            Console.WriteLine(ex);
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read/Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] {' ', '\t'}, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        if (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    #endregion
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hom
{
    class Program
    {
        static void Main(string[] args)
        {
            string inp;
            int n, a, b;
            int j = 0, z = 0;
            List<int> L = new List<int>();
            inp = Console.ReadLine();
            string[] smas = inp.Split(' ');
            n = Convert.ToInt32(smas[0]);
            a = Convert.ToInt32(smas[1]);
            b = Convert.ToInt32(smas[2]);
            inp = Console.ReadLine();
            string[] smasA = inp.Split(' ');
            inp = Console.ReadLine();
            string[] smasB = inp.Split(' ');
            for (int i = 0; i < n; i++)
            {
                L.Add(2);
                for(j=0; j<a; j++)
                {
                    if (Convert.ToInt32(smasA[j]) == i + 1)
                    {
                        L[i]=1;
                        break;
                    }
                }
            }
            string res="";
            foreach (int l in L)
            {
                res += " " + l.ToString();
            }
            Console.WriteLine(res.TrimStart());
        }
    }
}


using System;
using System.IO;
using System.Text;

namespace Pasha_and_Hamsters
{
    internal class Program
    {
        private static readonly StreamReader reader =
            new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);

        private static readonly StreamWriter writer =
            new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            string[] ss = reader.ReadLine().Split(' ');
            int n = int.Parse(ss[0]);
            int a = int.Parse(ss[1]);
            int b = int.Parse(ss[2]);

            var nn = new int[n + 1];
            ss = reader.ReadLine().Split(' ');
            for (int i = 0; i < a; i++)
            {
                nn[int.Parse(ss[i])] = 1;
            }

            ss = reader.ReadLine().Split(' ');
            for (int i = 0; i < b; i++)
            {
                nn[int.Parse(ss[i])] = 2;
            }

            for (int i = 1; i <= n; i++)
            {
                if (i != 1)
                    writer.Write(' ');

                writer.Write(nn[i]);
            }
            writer.Flush();
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace codeforces
{
    class Program
    {
        static string answer;
        static int[] a1;
        static int[] b1;
        static void proverka(int k)
        {
            for (int i = 0; i < a1.Length; i++)
            {
                if (k == a1[i]) { answer += 1 + " "; return; }
            }
            for (int i = 0; i < b1.Length; i++)
            {
                 if (k == b1[i]) { answer += 2 + " "; return; }
            }

        }
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] ss = s.Split(' ');
            int n = Convert.ToInt32(ss[0]);
            int a = Convert.ToInt32(ss[1]);
            int b = Convert.ToInt32(ss[2]);
            s = Console.ReadLine();
            ss=s.Split(' ');
             a1 = new int[a];
            for (int i = 0; i < ss.Length; i++)
            {
                a1[i] = Convert.ToInt32(ss[i]);
            }
            s = Console.ReadLine();
            ss = s.Split(' ');
             b1 = new int[b];
            for (int i = 0; i < ss.Length; i++)
            {
                b1[i] = Convert.ToInt32(ss[i]);
            }
            for (int i = 1; i <= n; i++)
            {
                proverka(i);
            }
            Console.WriteLine(answer);

        }
    }
}


using System;

namespace PashaAndHamsters
{
    partial class PashaAndHamsters
    {
        static void Main(string[] args)
        {
            int n, a, b;
            int[] arthur, alexander, apples;

            n = NextInt();
            a = NextInt();
            b = NextInt();

            arthur = new int[a];
            alexander = new int[b];
            apples = new int[n];

            for (int i = 0; i < a; i++)
                arthur[i] = NextInt() - 1;

            for (int i = 0; i < b; i++)
                alexander[i] = NextInt() - 1;

            for (int i = 0; i < a; i++)
                apples[arthur[i]] = 1;

            for (int i = 0; i < n; i++)
                if (apples[i] == 0)
                    apples[i] = 2;

            for (int i = 0; i < n; i++)
                Console.Write("{0} ", apples[i]);

            Console.WriteLine();
        }
    }

    partial class PashaAndHamsters
    {
        static string[] tokens = new string[0];
        static int cur_token = 0;

        static void ReadArray(char sep)
        {
            cur_token = 0;
            tokens = Console.ReadLine().Split(sep);
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int NextInt()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return int.Parse(tokens[cur_token++]);
        }

        static long NextLong()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return long.Parse(tokens[cur_token++]);
        }

        static double NextDouble()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return double.Parse(tokens[cur_token++]);
        }

        static decimal NextDecimal()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return decimal.Parse(tokens[cur_token++]);
        }

        static string NextToken()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return tokens[cur_token++];
        }

        static string ReadLine()
        {
            return Console.ReadLine();
        }
    }
}


using System;

public class Test
{
	public static void Main()
	{
		var x = int.Parse(Console.ReadLine());

		for(var i = (int)Math.Sqrt(x); i>=2; i--)
		{
			var y = x%i;
			if(y == 0)
			{
				Console.Write(i);
				Console.WriteLine(x/i);
				return;
			}
		}
	}
}


using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Collections;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            string buf = "1111111111";
            int a = Convert.ToInt32(Console.ReadLine());
            for (int i = 2; i < a; i++)
                for (int j = 1; j < a; j++)
                {
                    if (i * j == a) {
                        buf = j.ToString() + i.ToString();
                    }
                }
            Console.WriteLine(buf);
            Console.Read();
        }
    }
}


using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Collections;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
           int a = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("1" + a);
        }
    }
}


using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Collections;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = "1111111111", buf = "1111111111";
            int a = Convert.ToInt32(Console.ReadLine());
            for (int i = 1; i <= a; i++)
                for (int j = 1; j <= a; j++)
                {
                    if (i * j == a)
                        str = i.ToString() + j.ToString();
                    if (buf.Length > str.Length)
                        buf = str;
                }
            Console.WriteLine(buf);
            Console.ReadLine();
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Calendar
{
    class Program
    {
        static void Main(string[] args)
        {
            int v = 3200;
            long a,n,j,i,p,an,k;
            long[] kv = new long[v+1];
            long[] my = new long [1000001];
            string s;
            string[] ss;

            s = Console.ReadLine();
            ss = s.Split();
            a = Convert.ToInt32(ss[0]);
            n = Convert.ToInt32(ss[1]);
  // a:=1;
  // n := 9;
            p  = 0;
            an = a + n - 1;

            for (i = 1; i <= v; i++) kv[i] = i*i;

            for (i = a; i <= an; i++) my[i] = 1;

            for (i = 2; i <= v; i++)
            {

                for (j = 1; j <= v; j++)
                {
                    k = kv[i] * j;
                    if (k < a) continue;
                    if (k > an) break;
                    my[k] = kv[i];
                }
            }

            for (i = a; i <= an; i++) p = p + i/my[i];

              Console.WriteLine(p);

        }
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Linq;

namespace Codeforces
{
    internal class Program
    {
        private const string Test = "D1";

        private static int[] squares;
        private static void Solve()
        {
            var input = ReadIntArray();
            var a = input[0];
            var n = input[1];

            squares = new int[10000001];
            for (int i = 3162; i >=1; i--)
            {
                var sq = i*i;
                for (int j = 1; j*sq <= 10000000; j++)
                {
                    var index = sq*j;
                    if(squares[index] == 0)
                        squares[index] = sq;
                }
            }

            var dp = new long[a + n];
            for (int i = 1; i < a + n; i++)
            {
                dp[i] = dp[i-1] + GetCounts(i);
            }
            var res = dp[a + n - 1] - dp[a - 1];
            Console.WriteLine(res);
        }

        private static int GetCounts(int n)
        {
            if (n == 0)
                return 0;

            if (squares[n] == 0)
                return n;

            var res = n/squares[n];
            return res;
        }

        private static void Main()
        {
            if (Debugger.IsAttached)
            {
                //Console.SetIn(new StreamReader(String.Format(@"..\..\..\..\Tests\{0}.in", Test)));
            }

            Solve();

            if (Debugger.IsAttached)
            {
                Console.In.Close();
                Console.SetIn(new StreamReader(Console.OpenStandardInput()));
                Console.ReadLine();
            }
        }

        #region Reader

        private static string Read()
        {
            return Console.ReadLine();
        }

        private static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        private static List<int> ReadIntArray()
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();
            return input;
        }

        private static int ReadInt()
        {
            return Int32.Parse(Console.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static int ReadNextInt(string[] input, int index)
        {
            return Int32.Parse(input[index]);
        }

        #endregion
    }
}