from functools import lru_cache

def main():
    n,m = map(int,input().split())
    A = []
    for _ in range(m):
        a = int(input())
        A.append(a)
    mod = 10**9+7
    @lru_cache(maxsize=1000000)
    def root(n):
        if n==0:
            return 1
        if n==1:
            if 1 in A:
                return 0
            else:
                return 1
        else:
            if n-1 in A and n-2 in A:
                return 0
            elif n-1 in A and n-2 not in A:
                return root(n-2)%mod
            elif n-1 not in A and n-2 in A:
                return root(n-1)%mod
            else:
                return (root(n-1)+root(n-2))%mod
    print(root(n))

if __name__ == "__main__":
    main()