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.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.ArrayList;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;
import java.util.PriorityQueue;
import java.util.HashMap;
import java.util.Stack;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.lang.reflect.Field;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.TreeSet;
import java.math.BigDecimal;
import java.util.Comparator;
import java.util.BitSet;
import java.util.Random;
import java.util.ArrayDeque;
import java.math.*;
import java.util.List;
import java.util.Iterator;
import java.io.*;
public class Main{
    final static boolean DEBUG=false;
    static InputStream inputStream ;
    static OutputStream outputStream ;
    static InputReader in ;
    static OutputWriter outt ;
    static FileInputStream fstream ;;
    static DataInputStream in1;
    static BufferedReader x1 ;
    static FileOutputStream out ;
    static String newLine="\n";
    static StringBuilder outtt=new StringBuilder();
       public static void main(String []args)throws IOException{
        if(!DEBUG){
            inputStream = System.in;
            outputStream = System.out;
            in = new InputReader(inputStream);
            outt = new OutputWriter(outputStream);
        }
        else{
            fstream = new FileInputStream("input.txt");
            in1 = new DataInputStream(fstream);
            x1 = new BufferedReader(new InputStreamReader(in1));
            out = new FileOutputStream(new File("output.txt"));
        }
       Main Solver=new Main();
        int T;
       
        
          // T=in.readInt();
          T=1;
        while(T-->0)
            Solver.solve();
            outt.print(outtt);
            if(!DEBUG)
            outt.close();
        else 
            out.close();
            
 }
 public void solve()throws IOException{
      int N=in.readInt();
      int M=in.readInt();
      int a[]=new int[N];
      for(int i=0;i<N;i++)
        a[i]=in.readInt();
      int l[]=new int[M];
      for(int i=0;i<M;i++)
        l[i]=in.readInt();
      int freq[]=new int[N];
      HashMap<Integer,Integer> f=new HashMap<Integer,Integer>();
      for(int i=N-1;i>=0;i--)
        {
            f.put(a[i],0);
            freq[i]=f.size();
        }
      for(int i=0;i<M;i++)
        outtt.append(freq[l[i]-1]+"\n");
        }
       
       
         static long pow(long n, long exp,long mod){
            long prod = 1;
            while (exp > 0){
                if ((exp & 1) != 0){
                    prod *= n;
                    if(prod>=mod)
                    prod=prod%mod;
                }
                n*=n;
                if(n>=mod)
                n=n%mod;
                exp >>= 1;
            }
            return prod;
 }
       static  long[] generatePrimes(int max) {
            boolean[] isComposite = new boolean[max + 1];
            for (int i = 2; i * i <= max; i++) {
                if (!isComposite [i]) {
                    for (int j = i; i * j <= max; j++) {
                        isComposite [i*j] = true;
                    }
                }
            }
            int numPrimes = 0;
            for (int i = 2; i <= max; i++) {
                if (!isComposite [i]) numPrimes++;
            }
           // HashMap<Integer,Boolean> primes=new HashMap<Integer,Boolean>();
           long primes[]=new long[numPrimes];
                int index = 0;
                for (int i = 2; i <= max; i++) {
                    if (!isComposite [i]) primes[index++]=i;;
                }
                return primes;
            }
    }
class InputReader {
    
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;
 
    public InputReader(InputStream stream) {
        this.stream = stream;
    }
 
    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }
 
    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }
    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }
 
    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }
 
    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }
 
    public String next() {
        return readString();
    }
 
    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}
 
class OutputWriter {
    private final PrintWriter writer;
 
    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }
 
    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }
 
    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }
 
    public void printLine(Object...objects) {
        print(objects);
        writer.println();
    }
 
    public void close() {
        writer.close();
    }}   