You are given a sequence A1,A2,…,AN of length N. Count the contiguous intervals whose sum is divisible by M.
An interval is a pair (i,j) with 1≤i≤j≤N, and it covers Ai through Aj. Two intervals count as different when they differ in i or in j.
The first line contains N and M, separated by a space. (1≤N≤106, 2≤M≤103)
The second line contains the N numbers of the sequence A1,A2,…,AN, separated by spaces. (0≤Ai≤109)
Print the number of intervals that satisfy the condition on the first line.