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.Map;
import java.util.StringTokenizer;

import static java.lang.Math.max;

public class Main {
    private final InputReader in;
    private final PrintWriter out;

    public Main(final InputReader in, final PrintWriter out) {
        this.in = in;
        this.out = out;
    }

    private static PrintWriter getOutput(final String filename) throws IOException {
        if (filename == null || filename.isEmpty()) {
            return new PrintWriter(new OutputStreamWriter(System.out));
        } else {
            return new PrintWriter(new FileWriter(filename + ".out"));
        }
    }

    public static void main(final String[] args) throws NumberFormatException, IOException {
        final String filename = "";
        final long time = System.currentTimeMillis();
        try (final InputReader in = new InputReader(filename); final PrintWriter out = getOutput(filename)) {
            new Main(in, out).solve();
        }
//        System.err.println("Running time: " + (System.currentTimeMillis() - time));
    }

    <K> void add(final Map<K, Integer> map, final K key) {
        map.put(key, map.containsKey(key) ? map.get(key) + 1 : 1);
    }

    <K> void delete(final Map<K, Integer> map, final K key, final int count) {
        final int newCount = map.get(key) - count;
        if (newCount < 0) {
            throw new RuntimeException();
        } else if (newCount == 0) {
            map.remove(key);
        } else {
            map.put(key, newCount);
        }
    }

    private void solve() throws IOException {
        final int n = in.nextInt();
        final int t = in.nextInt();
        final int k = Math.min(n, t);
        final int a[] = new int[n * k];

        final long[] count = new long[400];

        for (int i = 0; i < n; i++) {
            final int value = in.nextInt();
            count[value]++;
            for (int j = 0; j < k; j++) {
                a[i + j * n] = value;
            }
        }

        long maxCount = 0;
        for (int i = 0; i < count.length; i++) maxCount = max(maxCount, count[i]);

        final long[] dp = new long[400];
        long result = 0;
        for (int v : a) {
            long r = 0;
            for (int j = 1; j <= v; j++)
                r = max(r, dp[j]);
            dp[v] = r + 1;
            result = max(result, dp[v]);
        }

        result += maxCount * (t - k);

        out.println(result);
    }

    private long gcd(final long a, final long b) {
        return b > 0 ? gcd(b, a % b) : a;
    }
}

class InputReader implements Closeable {
    private StringTokenizer st;
    private final BufferedReader in;

    public InputReader(final String filename) throws IOException {
        if (filename == null || filename.isEmpty())
            in = new BufferedReader(new InputStreamReader(System.in));
        else
            in = new BufferedReader(new FileReader(filename + ".in"));
    }

    public boolean hasNextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null)
                return false;
            st = new StringTokenizer(line);
        }
        return true;
    }

    public String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null)
                return null;
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }

    public String readLine() throws IOException {
        return in.readLine();
    }

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

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

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

    @Override
    public void close() throws IOException {
        in.close();
    }
}