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.math.BigInteger;
import java.util.*;


public class B {

    void solve() throws IOException {
        int n=nextInt();
        int t=nextInt();
        int[] a=new int[n];
        int[] b=new int[n];
        for(int i=0;i<n;i++){
            a[i]=nextInt();
            b[i]=a[i];
        }
        if(t<=100){
            int[] c=new int[n*t];
            int k=0;
            for(int i=0;i<t;i++)
                for(int j=0;j<n;j++)
                    c[k++]=a[j];
            int[] dp=new int[k];
            dp[0]=1;
            for(int i=1;i<k;i++){
            for(int j=0;j<i;j++)
                if(c[j]<=c[i])dp[i]=Math.max(dp[j],dp[i]);
            dp[i]++;
            }
            int ans=0;
            for(int i=0;i<k;i++)ans=Math.max(ans,dp[i]);
            out.println(ans);
            return;

        }
        Arrays.sort(b);
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++)
                if(a[i]==b[j]){
                    a[i]=j;
                    break;
                }
        }

        int[][] add=new int[100][100];
        for(int k=0;k<100;k++){
//            if(l[k]==0)continue;
            int[] dp=new int[n];
            if(a[0]>=k)dp[0]=1;
            for(int i=1;i<n;i++){
                for(int j=0;j<i;j++)
                    if(a[j]<=a[i])dp[i]=Math.max(dp[j],dp[i]);
                if(a[i]>=k)
                    dp[i]++;
            }
            int[] l=new int[100];
            for(int i=0;i<n;i++)
                l[a[i]]=Math.max(l[a[i]],dp[i]);
            add[k]=l;
        }
        int[] count1=new int[100];
        for(int k=0;k<50;k++){
            int[] newCount=new int[100];
            for(int i=0;i<n;i++)
                for(int j=i;j<n;j++)newCount[j]=Math.max(newCount[j],count1[i]+add[i][j]);
            count1=newCount;
        }
        long ans=0;
        for(int i=0;i<100;i++){
            long cur=add[i][i]*1l*(t-100);
            int add1=0;
            for(int j=0;j<=i;j++)add1=Math.max(add1,count1[j]);
            int add2=0;
            int[] count2=new int[100];
            for(int k=0;k<50;k++){
                int[] newCount=new int[100];
                for(int i1=i;i1<n;i1++)
                    for(int j=i1;j<n;j++)
                        newCount[j]=Math.max(newCount[j],count2[i1]+add[i1][j]);
                count2=newCount;
            }
            for(int j=i;j<100;j++)add2=Math.max(add2,count2[j]);
            if(cur+add1+add2>ans){
                ans=Math.max(cur+add1+add2,ans);
            }

        }
        out.println(ans);
    }

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

    void run() throws IOException {
        reader = new BufferedReader(new InputStreamReader(System.in));
//      reader = new BufferedReader(new FileReader("input.txt"));
        tokenizer = null;
        out = new PrintWriter(new OutputStreamWriter(System.out));
//      out = new PrintWriter(new FileWriter("output.txt"));
        solve();
        reader.close();
        out.flush();

    }

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter out;

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}