import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    MOD = 1000000007
    n, m = map(int, input().split())

    a = []
    pre = -10
    for _ in range(m):
        i = int(input())
        if i == pre + 1:
            print(0)
            quit()
        a.append(i)
        pre = i

    dp = [0] * (n+1)
    dp[0] = 1
    for i in range(1, n+1):
        if i in a:
            continue
        dp[i] += dp[i-1]
        if i >= 2:
            dp[i] += dp[i-2]
        dp[i] %= MOD
    print(dp[-1])

if __name__ == '__main__':
    main()
