N, X = map(int, input().split()) A = list(map(int, input().split())) from collections import defaultdict dic = defaultdict(int) for a in A: dic[a] += 1 if X > 2 * 10 ** 5: print(0) exit() ans = 0 for i in range(X+1): ans += dic[i] * dic[X-i] print(ans)