Problem: 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

Solution (in JAVA):

Solution:
import java.io.*;
import java.time.temporal.IsoFields;
import java.util.*;

import javax.swing.text.html.MinimalHTMLWriter;

import static java.lang.Math.abs;
import static java.lang.Math.max;
import static java.lang.Math.min;


public class Main {


    public static void main(String [] args){
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Integer readFromFile=new Integer(1);
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskD {
    	void madAdd(Map <Integer, Integer> map, int value){
            if(map.containsKey(value)){
                map.put(value, map.get(value)+1);
            }else{
                map.put(value, 1);
            }
        }
    	//I have to try at least two ways to solve this problem, I'll make one of them with ;
    	class Pair implements Comparable<Pair>{
    		int fist;
    		int second;
    		Pair(int fist, int second){
    			this.fist = fist;
    			this.second = second;
    		}
			@Override
			public int compareTo(Pair arg0) {
				if(arg0.fist!=arg0.second){
					return fist-arg0.fist;
				}else{
					return arg0.second-second;
				}
			}
    	}
    	
    	public void solve(int testNumber, InputReader in, PrintWriter out) {
    		int n = in.nextInt();
    		int m = in.nextInt();
    		int A[] = new int[n];
    		int dp[] = new int[n];
    		for(int i=0; i<n; i++){
    			A[i] = in.nextInt();
    		}
    		Set<Integer> mount = new HashSet<>(n);
    		for(int i=n-1; i>=0; i--){
    			mount.add(A[i]);
    			dp[i] = mount.size();
    		}
    		
    		while(m-->0){
    			int q = in.nextInt()-1;
    			out.println(dp[q]);
    		}
    		
        }
    }
    
    static class InputReader {
        BufferedReader br;
        StringTokenizer st;
        String st1;
        File file = new File("D:\\text.txt");
        public InputReader(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }
        public InputReader(int i) {
            try {
                br  = new BufferedReader(
                        new InputStreamReader(new FileInputStream(file)));
            } catch (FileNotFoundException e1) {
                System.out.println("File is not find");
            }
            st = null;
        }
        public String next(){
            while (st==null || !st.hasMoreTokens()){
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public String nextLine(){
            try {
                st1 = new String(br.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return st1;
        }
        public int nextInt()  {return Integer.parseInt(next());}
        public long nextLong(){
            return Long.parseLong(next());
        }
        public Double nextDouble(){
            return Double.parseDouble(next());
        }
        public Byte nextByte() {
            return Byte.parseByte(next());
        }
        private int idx;
        public Character nextChar() {
            if(st1==null) {
                st1 = next();
                idx = 0;
            }
            if(idx!=(st1.length())-1){
                return st1.charAt(idx++);
            }else{
                char  c= st1.charAt(idx);
                st1 = null;
                return c;
            }
        }
        public void newFile() {
            try {
                FileWriter write = new FileWriter(file);
                write.write("something for cheaking");
                write.close();

            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        public void writeFile1(){
            try{
                FileWriter write = new FileWriter(file);
                write.append("100000"+" ");
                for(int i=0; i<100000; i++){
                    write.append(new Integer((int)(Math.random()*5000)).toString()+" ");
                }
                write.close();

            }catch(IOException e){
                e.printStackTrace();
            }
        }
    }
}