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
# WHERE: https://codeforces.com/problemset/page/8?order=BY_RATING_ASC
# AND https://codeforces.com/problemset/page/9?order=BY_RATING_ASC

# Taxi
# https://codeforces.com/problemset/problem/158/B
# Input
# The first line contains integer n (1 ≤ n ≤ 105) — the number of groups of schoolchildren. The second line contains a sequence of integers s1, s2, ..., sn (1 ≤ si ≤ 4). The integers are separated by a space, si is the number of children in the i-th group.
# Output
# Print the single number — the minimum number of taxis necessary to drive all children to Polycarpus.
# ignoreInput = input()
# groups = list(map(int, input().split()))
# i = 0
# j = len(groups) - 1  # last position of the array
# counter = 0

# counters = [0, 0, 0, 0]

# for group in groups:
#     counters[(group-1)] += 1

# fours = counters[3]
# threes = counters[2]
# ones = 0
# if counters[0] > threes:
#     ones = counters[0] - threes
# twos = (counters[1]//2) + (((counters[1] % 2)*2+ones)//4)
# # left = 0
# if (((counters[1] % 2)*2+ones) % 4) != 0:
#     twos += 1

# print(fours+threes+twos)
# ---------------------------------------------------------------------------------------------------------------------

# Fancy Fence
# https://codeforces.com/problemset/problem/270/A
# Input
# The first line of input contains an integer t (0 < t < 180) — the number of tests. Each of the following t lines contains a single integer a (0 < a < 180) — the angle the robot can make corners at measured in degrees.
# Output
# For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.

# times = int(input())
# answers = []
# for time in range(times):
#     a = int(input())
#     if 360 % (180 - a) == 0:
#         answers.append("YES")
#     else:
#         answers.append("NO")
# for answer in answers:
#     print(answer)
# ---------------------------------------------------------------------------------------------------------------------

# Interesting drink
# https://codeforces.com/problemset/problem/706/B
# Input
# The first line of the input contains a single integer n (1 ≤ n ≤ 100 000) — the number of shops in the city that sell Vasiliy's favourite drink.
# The second line contains n integers xi (1 ≤ xi ≤ 100 000) — prices of the bottles of the drink in the i-th shop.
# The third line contains a single integer q (1 ≤ q ≤ 100 000) — the number of days Vasiliy plans to buy the drink.
# Then follow q lines each containing one integer mi (1 ≤ mi ≤ 109) — the number of coins Vasiliy can spent on the i-th day.
# Output
# Print q integers. The i-th of them should be equal to the number of shops where Vasiliy will be able to buy a bottle of the drink on the i-th day.
# def binarySearch(array, target, carry):
#     index = len(array)
#     if len(array) == 0:
#         return carry
#     if index == 1:
#         if target < array[0]:
#             return carry
#         else:
#             return carry + 1
#     # position in the middle
#     index = index//2
#     if target < array[index]:
#         # return the left
#         newPrices = array[0:index]
#         return binarySearch(newPrices, target, carry)
#     else:
#         # return the right
#         carry += (index)
#         newPrices = array[index:]
#         return binarySearch(newPrices, target, carry)

# nShops = int(input())
# shopPrices = list(map(int, input().split()))
# shopPrices.sort()
# times = int(input())
# answers = []

# def iterativeBinary(array, target):
#     low = 0
#     high = len(array) - 1
#     while (low <= high):
#         mid = low + ((high-low)//2)
#         print(mid)
#         if array[mid] > target:
#             high = mid - 1
#         else:
#             low = mid + 1
#     return low

# for time in range(times):
#     money = int(input())
#     # looks like the way i implemented the binary search isnt logN :(
#     # buys = binarySearch(shopPrices, money, 0)
#     buys = iterativeBinary(shopPrices, money)
#     answers.append(buys)
# for answer in answers:
#     print(answer)
# ---------------------------------------------------------------------------------------------------------------------

# A and B and Compilation Errors
# https://codeforces.com/problemset/problem/519/B
# Output
# Print two numbers on a single line: the numbers of the compilation errors that disappeared after B made the first and the second correction, respectively.

# compilationTimes = int(input())
# errors1 = list(map(int, input().split()))
# errors2 = list(map(int, input().split()))
# errors3 = list(map(int, input().split()))

# errors1.sort()
# errors2.sort()
# errors3.sort()

# n = -1
# isNFound = False
# m = 1
# isMFound = False
# for time in range(compilationTimes):
#     if isNFound and isMFound:
#         break
#     if not isNFound:
#         if time < len(errors2):
#             if errors1[time] != errors2[time]:
#                 n = errors1[time]
#                 isNFound = True
#         else:
#             n = errors1[time]
#             isNFound = True

#     if not isMFound:
#         if time < len(errors3):
#             if errors2[time] != errors3[time]:
#                 m = errors2[time]
#                 isMFound = True
#         else:
#             m = errors2[time]
#             isNFound = True


# print(n)
# print(m)
# ---------------------------------------------------------------------------------------------------------------------

# Double Cola
# https://codeforces.com/problemset/problem/82/A
# Input
# The input data consist of a single integer n (1 ≤ n ≤ 109).
# It is guaranteed that the pretests check the spelling of all the five names, that is, that they contain all the five possible answers.
# Output
# Print the single line — the name of the person who drinks the n-th can of cola. The cans are numbered starting from 1. Please note that you should spell the names like this: "Sheldon", "Leonard", "Penny", "Rajesh", "Howard" (without the quotes). In that order precisely the friends are in the queue initially.
# target = int(input())
# people = ["Sheldon", "Leonard", "Penny", "Rajesh", "Howard"]
# target -= 1
# k = 0
# while True:
#     if 5 * (2**k - 1) > target:
#         break
#     k += 1
# k -= 1
# corrimiento = target - (5 * (2**k - 1))
# realK = 2**(k)
# positionArray = (corrimiento)//realK
# print(people[positionArray])
# ---------------------------------------------------------------------------------------------------------------------

# stringToCheck = input()
# times = int(input())
# answers = []
# for time in range(times):
#     query = list(map(int, input().split()))
#     subArray = stringToCheck[query[0]-1:(query[1])]
#     i = 0
#     answer = 0
#     while i < (len(subArray)-1):
#         if subArray[i] == subArray[i+1]:
#             answer += 1
#         i += 1
#     answers.append(answer)
# for ans in answers:
#     print(ans)
# ---------------------------------------------------------------------------------------------------------------------

# Two Teams Composing
# https://codeforces.com/problemset/problem/1335/C
# testCases = int(input())
# answers = []
# for testCase in range(testCases):
#     ignoreInput = input()
#     teammates = input().split()
#     teammates.sort(reverse=True)
#     powers = {}
#     maxTarget = len(teammates)//2

#     for mate in teammates:
#         if mate in powers:
#             powers[mate] += 1
#         else:
#             powers[mate] = 1

#     powersLen = len(powers)

#     new_powers = sorted(powers.items(), key=lambda x: x[1], reverse=True)
#     if len(teammates) == 1:
#         answers.append(maxTarget)
#     else:
#         for i in range(maxTarget):
#             if powersLen == maxTarget:
#                 isValid = False
#                 for power, count in new_powers:
#                     if count > maxTarget:
#                         isValid = True
#                         break
#                     else:
#                         break
#                 if isValid:
#                     answers.append(maxTarget)
#                     break
#                 maxTarget -= 1
#             elif powersLen > maxTarget:
#                 isValid = False
#                 for power, count in new_powers:
#                     if count >= maxTarget:
#                         isValid = True
#                         break
#                     else:
#                         break
#                 if isValid:
#                     answers.append(maxTarget)
#                     break
#                 maxTarget -= 1
#             else:
#                 maxTarget -= 1
# for answer in answers:
#     print(answer)
# ---------------------------------------------------------------------------------------------------------------------

# Sum of Odd Integers
# https://codeforces.com/problemset/problem/1327/A

# for i in range(int(input())):
#     n, k = map(int, input().split())
#     print('YES' if k * k <= n and n % 2 == k % 2 else 'NO')
# ---------------------------------------------------------------------------------------------------------------------

# https://codeforces.com/problemset/problem/456/A
# Laptops
# Input
# The first line contains an integer n (1 ≤ n ≤ 105) — the number of laptops.
# Next n lines contain two integers each, ai and bi (1 ≤ ai, bi ≤ n), where ai is the price of the i-th laptop, and bi is the number that represents the quality of the i-th laptop (the larger the number is, the higher is the quality).
# All ai are distinct. All bi are distinct.
# Output
# If Alex is correct, print "Happy Alex", otherwise print "Poor Alex" (without the quotes).

# computers = {}

# for i in range(int(input())):
#     price, quality = map(int, input().split())
#     computers[price] = quality

# sortedByQuality = sorted(computers.items(), key=lambda x: x[1], reverse=True)

# isHappy = False
# for idx in range(1, len(sortedByQuality)):
#     if sortedByQuality[idx][0] > sortedByQuality[(idx-1)][0]:
#         isHappy = True
#         break
# if isHappy:
#     print("Happy Alex")
# else:
#     print("Poor Alex")
# ---------------------------------------------------------------------------------------------------------------------


# Fence
# https://codeforces.com/problemset/problem/363/B
# Input
# The first line of the input contains integers n and k (1 ≤ n ≤ 1.5·105, 1 ≤ k ≤ n) — the number of planks in the fence and the width of the hole for the piano. The second line contains the sequence of integers h1, h2, ..., hn (1 ≤ hi ≤ 100), where hi is the height of the i-th plank of the fence.
# Output
# Print such integer j that the sum of the heights of planks j, j + 1, ..., j + k - 1 is the minimum possible. If there are multiple such j's, print any of them.

# def sumList(arrayLi):
#     result = 0
#     for inte in arrayLi:
#         result += inte
#     return result


# fenceWidth, pianoWidth = list(map(int, input().split()))
# fenceHeights = list(map(int, input().split()))
# lesserIndex = 0
# lesserSum = sumList(fenceHeights[:pianoWidth])
# currentSum = sumList(fenceHeights[:pianoWidth])

# for i in range(pianoWidth, fenceWidth):
#     currentSum = currentSum - fenceHeights[i-pianoWidth] + fenceHeights[i]
#     if lesserSum > currentSum:
#         lesserSum = currentSum
#         lesserIndex = i-pianoWidth+1

# print(lesserIndex+1)
# ---------------------------------------------------------------------------------------------------------------------


# Sereja and Suffixes

# https://codeforces.com/problemset/problem/368/B
# 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.

arraySize, times = list(map(int, input().split()))
arrayNumbers = list(map(int, input().split()))
keysFound = {}
positions = {}
# calculate all posible diferents
index = arraySize - 1
while index >= 0:
    newKeyFound = arrayNumbers[index]
    keysFound[newKeyFound] = 'found'
    positions[index] = len(keysFound)
    index -= 1

for time in range(times):
    position = int(input())
    print(positions[position-1])

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

# ---------------------------------------------------------------------------------------------------------------------
