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.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Codeforces {

    StringTokenizer tok;
    BufferedReader in;
    PrintWriter out;

    final boolean OJ = System.getProperty("ONLINE_JUDGE") != null;

    String filename = null;

    void init() {
        try {
            if (OJ) {
                if (filename == null) {
                    in = new BufferedReader(new InputStreamReader(System.in));
                    out = new PrintWriter(System.out);
                } else {
                    in = new BufferedReader(new FileReader("input.txt"));
                    out = new PrintWriter("output.txt");
                }
            } else {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    String readString() {
        try {
            while (tok == null || !tok.hasMoreTokens()) {
                tok = new StringTokenizer(in.readLine());
            }
            return tok.nextToken();
        } catch (Throwable t) {
            throw new RuntimeException(t);
        }
    }

    int readInt() {
        return Integer.parseInt(readString());
    }

    long readLong() {
        return Long.parseLong(readString());
    }

    public static void main(String[] args) {
        new Codeforces().run();
    }

    void run() {
        init();
        long time = System.currentTimeMillis();
        solve();
        System.err.println(System.currentTimeMillis() - time);
        out.close();
    }

    int gcd(int a, int b) {
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    int calc(int[] a, int minv, int maxv) {
        if (a.length == 0) return 0;
        int n = a.length;
        int[] dp = new int[n];
        for (int i = 0; i < n; i++) {
            if (a[i] < minv || a[i] > maxv) {
                dp[i] = Integer.MIN_VALUE;
                continue;
            }
            int max = 0;
            for (int j = 0; j < i; j++) {
                if (a[j] <= a[i]) max = Math.max(max, dp[j]);
            }
            dp[i] = max + 1;
        }
        int max = 0;
        for (int i = 0; i < n; i++) {
            max = Math.max(dp[i], max);
        }
        return max == Integer.MIN_VALUE ? 0 : max;
    }

    long solution(int n, int t, int[] a) {
        if (t < 4) {
            return naive(n, t, a);
        }
        int[][] cost = new int[301][301];

        for (int i=1;i<=300;i++) {
            for (int j=i;j<=300;j++) {
                cost[i][j] = calc(a, i, j);
            }
        }

        int[] cnteq = new int[301];
        for (int i=0;i<n;i++) cnteq[a[i]]++;


        long[][] start = new long[301][301];
        long[][] end = new long[301][301];
        for (int i=0;i<301;i++) {
            Arrays.fill(start[i], Long.MIN_VALUE);
            Arrays.fill(end[i], Long.MIN_VALUE);
        }
        start[0][1] = 0;
        end[0][300] = 0;
        for (int i=1;i<301;i++) {
            for (int j=0;j<i;j++) {
                for (int cnt = 1;cnt < 301;cnt++) {
                    if (start[cnt - 1][j] != Long.MIN_VALUE) {
                        start[cnt][i] = Math.max(start[cnt][i], start[cnt -1][j] + cost[j][i]);
                    }
                }
            }
        }

        for (int i=299;i>=1;i--) {
            for (int j=300;j>i;j--) {
                for (int cnt = 1;cnt < 301;cnt++) {
                    if (end[cnt - 1][j] != Long.MIN_VALUE) {
                        end[cnt][i] = Math.max(end[cnt][i], end[cnt -1][j] + cost[i][j]);
                    }
                }
            }
        }



        long max = 0;
        for (int i=1;i<=300;i++) {
            for (int cnt=0;cnt<=300;cnt++) {
                for (int cnt2=0;cnt2<=300;cnt2++) {
                    if (cnt + cnt2 <= t && start[cnt][i] != Long.MIN_VALUE && end[cnt2][i] != Long.MIN_VALUE) {
                        max = Math.max(max, start[cnt][i] + end[cnt2][i] + (long)(t - cnt - cnt2) * cnteq[i]);
                    }
                }
            }
        }
        return max;
    }

    long naive(int n, int t, int[] a) {
        int[] b = new int[n * t];
        for (int i=0;i<n*t;i++) {
            b[i] = a[i % n];
        }
        return calc(b,1,300);

    }

    void solve() {
        int n = readInt();
        int t = readInt();
        int[] a = new int[n];
        for (int i=0;i<n;i++) a[i] = readInt();

        out.println(solution(n,t,a));

//        Random rnd = new Random();
//        while (true) {
//            int n = rnd.nextInt(5) + 1;
//            int t = rnd.nextInt(10) + 1;
//            int[] a = new int[n];
//            for (int i=0;i<n;i++) a[i] = rnd.nextInt(10) + 1;
//            if (naive(n,t,a) != solution(n,t,a)) {
//                out.println(n + " " + t);
//                out.println(Arrays.toString(a));
//                break;
//            }
//        }
    }

}