Skip to content

Instantly share code, notes, and snippets.

@shiracamus
Last active June 10, 2019 20:12
Show Gist options
  • Save shiracamus/1d4a2588fe6bea3b289545418eeec88d to your computer and use it in GitHub Desktop.
Save shiracamus/1d4a2588fe6bea3b289545418eeec88d to your computer and use it in GitHub Desktop.
N, M = map(int, input().split())
a = {int(input()) for i in range(M)}
n, m = 1, 0
for i in range(1, N + 1):
n, m = (i not in a) * (n + m) % 1000000007, n
print(n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment