import java.io.*;
import java.util.*;
import java.math.*;

public class excursion_aa {
	public static void main(String[] args) {
		new excursion_aa().run();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	boolean eof = false;

	public void run() {
		Locale.setDefault(Locale.US);
		try {
			br = new BufferedReader(new FileReader(FNAME + ".in"));
			out = new PrintWriter(FNAME + ".out");
			solve();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(566);
		}
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

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

	void myAssert(boolean u, String message) {
		if (!u) {
			throw new Error("Assertion failed!!! " + message);
		}
	}

	int inBounds(int x, int l, int r, String name) {
		myAssert(l <= x && x <= r, name + " is not in bounds: " + x
				+ " not in [" + l + ", " + r + "]");
		return x;
	}

	String FNAME = "excursion";

	int BOUND = (int) 1e5;

	private void solve() throws IOException {
		int n = inBounds(nextInt(), 1, BOUND, "n");
		int k = inBounds(nextInt(), 1, n, "k");
		int[] a = new int[n];
		for (int i = 0; i < a.length; i++) {
			a[i] = inBounds(nextInt(), 1, (int) 1e9, "a_" + (i + 1));
		}
		HashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();
		int best = 0;
		int ans = 0;
		for (int i = 0; i < k; i++) {
			if (!hm.containsKey(a[i])) {
				best++;
			}
			hm.put(a[i], i);
		}
		int now = best;
		for (int i = k; i < a.length; i++) {
			if (hm.get(a[i - k]) == i - k) {
				now--;
			}
			if (!hm.containsKey(a[i]) || hm.get(a[i]) + k < i) {
				now++;
			}
			hm.put(a[i], i);
			if (now > best) {
				best = now;
				ans = i - k + 1;
			}
		}
		out.println(ans + 1);
	}
}
