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.*;
public class q1 {
    public static void main(String[] args) throws Exception
    {
        InputReader in=new InputReader(System.in);
        PrintWriter pw=new PrintWriter(System.out);
        int n=in.nextInt();
        int t=in.nextInt();
        int[] a=new int[n];
        int[] freq=new int[301];
        for(int i=0;i<n;i++)
        {
            a[i]=in.nextInt();
            freq[a[i]]++;
        }
        int[] max=new int[301];
        int[] b=new int[n*n];
        for(int i=0;i<n*n;i++)
        {
            b[i]=a[i%n];
        }
        /*for(int i=0;i<n*n;i++)
        {
            pw.print(b[i]+" ");
        }*/
        int mm=0;
        for(int i=1;i<=300;i++)
        {
            mm=Math.max(mm, freq[i]);
        }
        int ww=Math.min(t, n);
        int ans=function(b,ww*n);
        //pw.println(ans);
        if(t>n)
        {
            ans+=(t-n)*(mm);
        }
        pw.println(ans);
        pw.close();
        
    }
    public static int function(int[] a,int n)
    {
        int[] tailtable=new int[n];
        int len=1;
        tailtable[0]=a[0];
        for(int i=1;i<n;i++)
        {
            if(a[i]<tailtable[0])
            {
                tailtable[0]=a[i];
            }
            else if(a[i]>=tailtable[len-1])
            {
                tailtable[len]=a[i];
                len++;
            }
            else
            {
                tailtable[findceil(tailtable,-1,len-1,a[i])]=a[i];
                
            }
        }
        return len;
    }
    public static int findceil(int[] a,int left,int right,int key)
    {
        int m;
        while(right-left>1)
        {
            m=(left+right)/2;
            if(a[m]>key)
            {
                right=m;
            }
            else
            {
                left=m;
            }
        }
        return right;
    }
    
    
    
    
    
    
     static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));

            return res * sgn;
        }
        
        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }

            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));

            return res * sgn;
        }
        
        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

}
