This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
MOD = 10**9 + 7
n, l = map(int, input().split())
radii = list(map(int, input().split()))
dp = [0] * (n + 1)
dp[0] = 1
for i in range(1, n + 1):
dp[i] = dp[i - 1] * (l - sum(max(0, radii[i - 1] - radii[j - 1]) for j in range(1, i)) % MOD) % MOD
print(dp[n])
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |