You are given an array of positive integers a1, a2, ..., an × T of length n × T. We know that for any i > n it is true that ai = ai - n. Find the length of the longest non-decreasing sequence of the given array.

Input

The first line contains two space-separated integers: n, T (1 ≤ n ≤ 100, 1 ≤ T ≤ 107). The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 300).

Output

Print a single number — the length of a sought sequence.

Examples

Input

4 3
3 1 4 2


Output

5

Note

The array given in the sample looks like that: 3, 1, 4, 2, 3, 1, 4, 2, 3, 1, 4, 2. The elements in bold form the largest non-decreasing subsequence. 
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.StringTokenizer;

public class D {
    static int []t = new int[4 * 305];
    static int []a = new int[10005];
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int T = in.nextInt();
        int maxblocks = Math.min(10000/n,T);
        int leftblocks = Math.abs(maxblocks - T);
       // out.println(maxblocks + " " + leftblocks);

        int []cnt = new int[305];
        Arrays.fill(t,0);
        Arrays.fill(a,0);
        Arrays.fill(cnt,0);
        for (int i = 1; i <= n; ++i){
            a[i] = in.nextInt();
            cnt[a[i]]++;
        }
        //build(1,1,300);
       // out.println(get(1,1,300,1,n));
       // update(1,1,300,1,25);
       // out.println(get(1,1,300,1,n));

        for (int i = n + 1; i <= n * maxblocks; ++i){
            a[i] = a[i - n];
        }
        int ans = 0;
        int cur;
        for (int i = 1; i <= n * maxblocks; ++i){
            cur = get(1,1,300,1,a[i]) + 1;
            update(1,1,300,a[i],cur);
            ans = Math.max(ans, cur);
       //     out.println(i + " " +cur);

        }
        int MX = 0;
        for (int i = 1; i <= 300; ++i){
            MX = Math.max(MX,cnt[i]);

        }
        out.println(ans + MX * leftblocks);

        out.close();

    }
    public static void update(int v,int tl,int tr,int pos,int value)
    {
        if (tl == tr){
            t[v] = value;
            return;
        }
        int tm = (tl + tr) / 2;
        if (pos <= tm) {
            update(v + v, tl, tm, pos, value);
        }
        else {
            update(v + v + 1, tm + 1, tr, pos, value);
        }
        t[v] = Math.max(t[v + v],t[v + v + 1]);

    }
    public static int get(int v,int tl,int tr,int l,int r)
    {
        if (l > r) return 0;
        if (l == tl && r == tr) return t[v];
        int tm = (tl + tr) / 2;
        return Math.max(
                get(v + v, tl, tm, l, Math.min(r, tm)),
                get(v + v + 1, tm + 1, tr, Math.max(tm + 1, l), r)
        );
    }


}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }
    public String nextLine() throws IOException {
        return reader.readLine();
    }
    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

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

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

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