import math
import sys
input = sys.stdin.readline


def main():
    N, M = map(int, input().split())
    A = set([int(input()) for _ in range(M)])
    dp = [0] * (N + 1)
    dp[0] = 1
    if 1 not in A:
        dp[1] = 1
    mod = 10 ** 9 + 7
    for i in range(2, N + 1):
        if i in A:
            dp[i] = 0
        else:
            dp[i] = (dp[i-2] + dp[i-1]) % mod
    print(dp[-1])


if __name__ == '__main__':
    main() import math math import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def main():
    N, M = map(int, input().split())
    A = set([int(input()) for _ in range(M)])
    dp = [0] * (N + 1)
    dp[0] = 1
    if 1 not in A:
        dp[1] = 1
    mod = 10 ** 9 + 7
    for i in range(2, N + 1):
        if i in A:
            dp[i] = 0
        else:
            dp[i] = (dp[i-2] + dp[i-1]) % mod
    print(dp[-1]) main N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M int(input()) for _ in range(M) for _ in range(M) _ range(M) range M for _ in range(M) int(input()) int input() input A = set([int(input()) for _ in range(M)]) A set([int(input()) for _ in range(M)]) set [int(input()) for _ in range(M)] dp = [0] * (N + 1) dp [0] * (N + 1) [0] 0 N + 1 N 1 dp[0] = 1 dp[0] dp 0 1 if 1 not in A:
        dp[1] = 1
     1 not in A 1 A dp[1] = 1 dp[1] dp 1 1 mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 for i in range(2, N + 1):
        if i in A:
            dp[i] = 0
        else:
            dp[i] = (dp[i-2] + dp[i-1]) % mod
     i range(2, N + 1) range 2 N + 1 N 1 if i in A:
            dp[i] = 0
        else:
            dp[i] = (dp[i-2] + dp[i-1]) % mod
     i in A i A dp[i] = 0 dp[i] dp i 0 dp[i] = (dp[i-2] + dp[i-1]) % mod dp[i] dp i (dp[i-2] + dp[i-1]) % mod dp[i-2] + dp[i-1] dp[i-2] dp i-2 i 2 dp[i-1] dp i-1 i 1 mod print(dp[-1]) print dp[-1] dp -1 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main input = sys.stdin.readline sys.stdin.readline input def main():
    N, M = map(int, input().split())
    A = set([int(input()) for _ in range(M)])
    dp = [0] * (N + 1)
    dp[0] = 1
    if 1 not in A:
        dp[1] = 1
    mod = 10 ** 9 + 7
    for i in range(2, N + 1):
        if i in A:
            dp[i] = 0
        else:
            dp[i] = (dp[i-2] + dp[i-1]) % mod
    print(dp[-1]) def main():
    N, M = map(int, input().split())
    A = set([int(input()) for _ in range(M)])
    dp = [0] * (N + 1)
    dp[0] = 1
    if 1 not in A:
        dp[1] = 1
    mod = 10 ** 9 + 7
    for i in range(2, N + 1):
        if i in A:
            dp[i] = 0
        else:
            dp[i] = (dp[i-2] + dp[i-1]) % mod
    print(dp[-1]) main
import math
import sys
input = sys.stdin.readline


def main():
    N, M = map(int, input().split())
    A = set([int(input()) for _ in range(M)])
    dp = [0] * (N + 1)
    dp[0] = 1
    if 1 not in A:
        dp[1] = 1
    mod = 10 ** 9 + 7
    for i in range(2, N + 1):
        if i in A:
            dp[i] = 0
        else:
            dp[i] = (dp[i-2] + dp[i-1]) % mod
    print(dp[-1])


if __name__ == '__main__':
    main()
