n, m = input().split() arr_n = list(map(int, input().split())) arr_m = input().split() for i in arr_m: arr_n[int(i)-1] += 1 print(arr_n)