base = int(1e9+7)
fi = open("tong.inp","r")
n,k,p = map(int,fi.readline().split())
a = list(map(int,fi.readline().split()))
fi.close()
ssum = sum(a)
m = k // n
ssum = m * ssum
x = k % n
p = (p-1) % n
for i in range(0,x):
    ssum += a[(p+i)%n]

fo = open("tong.out","w")
fo.write(str(ssum % base))
fo.close()