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.awt.geom.Line2D;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StreamCorruptedException;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.InputMismatchException;
import java.util.Scanner;
import java.util.Stack;
import java.util.TreeSet;


public class q4
{
    public static void main(String[] args) {
        new q4().solve();
    }
    
    public q4()
    {
        in=new FasterScanner();
        out=new PrintWriter(System.out);
    }

    FasterScanner in;
    PrintWriter out;
 
    //long mod=1000000007L ;
   
    public void solve()
    {
        int n=in.nextInt();
        int t=in.nextInt();
        int[] b=new int[n+1];
        for(int i=1;i<=n;i++)
                b[i]=in.nextInt();
        int[] freq=new int[301];
//        int[] left=new int[301];
//        int[] right=new int[301];
        
        for(int i=1;i<=n;i++)
        {
            freq[b[i]]++;
        }
        int[] a=new int[n];

        int[] largleft=new int[301];
        
        if(t<2*n)
        {
            a=new int[t*n+1];
             int count=1;
             for(int i=0;i<t;i++)
             {
                for(int j=1;j<=n;j++)
                {
                    a[count++]=b[j];
                }
             }
             
             int max=0;
            
             for(int i=1;i<a.length;i++)
             {
                 int temp=0;
                
                 for(int j=1;j<=a[i];j++)
                 {
                    if(temp<largleft[j])
                    {
                        temp=Math.max(temp, largleft[j]);
                        
                    }
                 }
                 largleft[a[i]]=temp+1;
                 max=Math.max(max, largleft[a[i]]);
             }
             System.out.println(max);
             return;
        }
        
        a=new int[n*n+1];
        int count=1;
        for(int i=0;i<n;i++)
        {
            for(int j=1;j<=n;j++)
            {
                a[count++]=b[j];
            }
        }
        
        for(int i=1;i<a.length;i++)
        {
            int temp=0;
            for(int j=1;j<=a[i];j++)
            {
                temp=Math.max(temp, largleft[j]);
            }
            largleft[a[i]]=temp+1;
        }
        
//        if(t==1)
//        {
//            int ans=0;
//            for(int i=1;i<largleft.length;i++)
//            {
//                ans=Math.max(ans, largleft[i]);
//            }
//            System.out.println(ans);
//            return;
//        }
        
        int[] largright=new int[301];
        
        for(int i=a.length-1;i>=1;i--)
        {
            int temp=0;
            for(int j=a[i];j<largright.length;j++)
            {
                temp=Math.max(temp, largright[j]);
            }
            largright[a[i]]=temp+1;
        }
      
//      System.out.println("left");
//      for(int i=1;i<=300;i++)
//      {
//        if(freq[i]!=0)
//            System.out.print(" { "+i+" "+left[i]+" } ");
//      }
//      System.out.println();
//      System.out.println("right");
//      for(int i=1;i<=300;i++)
//      {
//        if(freq[i]!=0)
//          System.out.print(" { "+i+" "+right[i]+" } ");
//      }
      //System.out.println();
//      System.out.println("largeleft");
//      for(int i=1;i<=300;i++)
//      {
//        if(freq[i]!=0)
//              System.out.print(" { "+i+" "+largleft[i]+" } ");
//      }
//      System.out.println();
//      System.out.println("largeright");
//      for(int i=1;i<=300;i++)
//      {
//        if(freq[i]!=0)
//              System.out.print(" { "+i+" "+largright[i]+" } ");
//      }
//      System.out.println();
//      System.out.println("freq");
//      for(int i=1;i<=300;i++)
//      {
//        if(freq[i]!=0)
//              System.out.print(" { "+i+" "+freq[i]+" } ");
//      }
 //     System.out.println();
        
        for(int i=1;i<largleft.length;i++)
        {
            largleft[i]=Math.max(largleft[i], largleft[i-1]);
        }
        for(int i=largright.length-2;i>=1;i--)
        {
            largright[i]=Math.max(largright[i], largright[i+1]);
        }
        //System.out.println(left[42]+" "+right[42]+" "+largleft[42]+" "+largright[42]+" "+freq[42]);
       // System.out.println(largleft[192]+" "+largright[192]);
        int ans=0;
        for(int i=1;i<=300;i++)
        {
            int ttt=(t-2*n)*freq[i]+largleft[i]+largright[i];
            ans=Math.max(ans, ttt);
        }
        
        System.out.println(ans);
        out.close();
    }
    
       
    public static class FasterScanner {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

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

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
    }
} 