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. 
mul=lambda A,B,r:[[max([A[i][k]+B[k][j] for k in r if A[i][k] and B[k][j]],default=0) for j in r] for i in r]

def binpower(A,n,e):
    r  = range(n)
    B  = A  #A^0 is invalid, thus start from A^1
    e -= 1
    while True:
        if e &1: B = mul(B,A,r)
        e =e>>1
        if e==0: return B
        A =mul(A,A,r)

def f(l,n,T):
    # Part 1: cal M
    h = max(l)+1
    N = [[0]*h for _ in range(h)]
    Q = [[0]*h for _ in range(h)] 
    M = [[0]*n for _ in range(n)]
    for j in range(n):
        # update Mij based on Quv,(j-1)
        for i in range(n):
            M[i][j]=Q[l[i]][l[j]]+1 if l[i]<=l[j] else 0
        # update Nuv,(j) and Quv,(j)
        v = l[j]
        for u in range(1,v+1):
            N[u][v] = Q[u][v]+1
            for vv in range(v,h):
                Q[u][vv] = max(Q[u][vv],N[u][v])
    return max(max(binpower(M,n,T)))

n,T = list(map(int,input().split()))
l   = list(map(int,input().split()))
print(f(l,n,T))

