Sereja has an array a, consisting of n integers a1, a2, ..., an. The boy cannot sit and do nothing, he decided to study an array. Sereja took a piece of paper and wrote out m integers l1, l2, ..., lm (1 ≤ li ≤ n). For each number li he wants to know how many distinct numbers are staying on the positions li, li + 1, ..., n. Formally, he want to find the number of distinct numbers among ali, ali + 1, ..., an.?

Sereja wrote out the necessary array elements but the array was so large and the boy was so pressed for time. Help him, find the answer for the described question for each li.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 105). The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 105) — the array elements.

Next m lines contain integers l1, l2, ..., lm. The i-th line contains integer li (1 ≤ li ≤ n).

Output

Print m lines — on the i-th line print the answer to the number li.

Examples

Input

10 10
1 2 3 4 1 2 3 4 100000 99999
1
2
3
4
5
6
7
8
9
10


Output

6
6
6
6
6
5
4
3
2
1

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class Main {

	public static void solve(FastScanner fscan, BufferedWriter bw) throws IOException
	{
		int n = fscan.nextInt(),
			m = fscan.nextInt();
		int a[] = new int[n];
		
		for (int i = 0; i < a.length; i++) {
			a[i] = fscan.nextInt();
		}
		
		int dist[] = new int[n];
		boolean occured[] = new boolean[100001];
		
		dist[n-1] = 1;
		occured[a[n-1]] = true;
		for (int i = dist.length -2; i >= 0 ; i--) {
			dist[i] = dist[i+1];
			if(!occured[a[i]]) {
				occured[a[i]] = true;
				dist[i] += 1;
			}
		}
		
		int t;
		for (int i = 0; i < m; i++) {
			t = fscan.nextInt();
			bw.append(String.valueOf(dist[t-1]) + "\n");
		}
	}

	/**************** ENTER HERE   ********************/
	public static void main(String[] args) throws Exception {
		
		if(args.length != 0){
			test();
			return;
		}
		
		FastScanner fscan = new FastScanner(System.in);
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		solve(fscan,bw);
		bw.close();
	}
	
	/****   Test Static test cases      **/
	public static void test() throws IOException{
		String testcase[] = new String[]{};
		String answer[] = new String[]{};
		
		for (int i = 0; i < testcase.length; i++) {
			ByteArrayOutputStream result = new ByteArrayOutputStream();
			FastScanner fscan = new FastScanner(new ByteArrayInputStream(testcase[i].getBytes()));
			BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(result));
			
			solve(fscan, bw);
			
			String r = new String(result.toByteArray());
			if(! r.equals(answer[i])){
				String q = testcase[i];
				String a = answer[i];

				System.err.println("Wrong Answer on test:"+(i+1));
				System.err.println("Q:"+q);
				System.err.println("A:"+a);
				System.err.println("R:"+r);
			}
			
		}

	}
}





class FastScanner {
	InputStream is;
	byte buff[] = new byte[1024];
	int currentChar = -1;
	int buffChars = 0;

	public FastScanner(InputStream inputStream) {
		is = inputStream;
	}

	public boolean hasNext() throws IOException {
		return currentChar == -1 || buffChars > 0;
	}

	public char nextChar() throws IOException {
		// if we already have that next char read, just return else input
		if (currentChar == -1 || currentChar >= buffChars) {
			currentChar = 0;
			buffChars = is.read(buff);
		}

		if (buffChars <= 0) {
			throw new RuntimeException("No char found...");
		}

		int ch;
		while (isSpace(ch = nextCharAsInt()))
			;
		return (char) ch;
	}

	public int nextCharAsInt() throws IOException {
		// if we already have that next char read, just return else input
		if (currentChar == -1 || currentChar >= buffChars) {
			currentChar = 0;
			buffChars = is.read(buff);
		}

		if (buffChars <= 0) {
			return -1;
		}
		return (char) buff[currentChar++];
	}

	public String nextLine() throws IOException {
		StringBuilder bldr = new StringBuilder();
		int ch;
		while (isLineEnd(ch = nextCharAsInt()))
			// ignore empty lines ???
			;

		do {
			bldr.append((char) ch);
		} while (!isLineEnd(ch = nextCharAsInt()));

		return bldr.toString();
	}

	public String nextString() throws IOException {
		StringBuilder bldr = new StringBuilder();
		int ch;
		while (isSpace(ch = nextCharAsInt()))
			;

		do {
			bldr.append((char) ch);
		} while (!isSpace(ch = nextCharAsInt()));

		return bldr.toString();
	}

	public int nextInt() throws IOException {
		// considering ASCII files--> 8 bit chars, unicode files has 16 bit
		// chars (byte1 then byte2)
		int result = 0;
		int sign = 1;
		int ch;
		while (isSpace(ch = nextCharAsInt()))
			;

		if (ch == '-') {
			sign = -1;
			ch = nextCharAsInt();
		}

		do {
			if (ch < '0' || ch > '9')
				throw new NumberFormatException("Found '" + ch
						+ "' while parsing for int.");

			result *= 10;
			result += ch - '0';
		} while (!isSpace(ch = nextCharAsInt()));

		return sign * result;
	}

	public long nextLong() throws IOException {
		// considering ASCII files--> 8 bit chars, unicode files has 16 bit
		// chars (byte1 then byte2)
		long result = 0;
		int sign = 1;
		int ch;
		while (isSpace(ch = nextCharAsInt()))
			;

		if (ch == '-') {
			sign = -1;
			ch = nextCharAsInt();
		}

		do {
			if (ch < '0' || ch > '9')
				throw new NumberFormatException("Found '" + ch
						+ "' while parsing for int.");

			result *= 10;
			result += ch - '0';
		} while (!isSpace(ch = nextCharAsInt()));

		return sign * result;
	}

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

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

	public void close() throws IOException {
		is.close();
	}
}
