big = 10**9 + 7

def typical_stairs(n,m,a):

    route = [0]*(n+1)
    route[0] = 1
    ans = route[0]
    tmp = 0
    a.append(-1)
    for j in range(m+1):
        for i in range(tmp,n):
            if a[j] == i+1:
                #print("a=%d, i+2=%d "%(a[j],i+2))
                route[i+1] = 0
                tmp = a[j]
                #print("route%d, %d = 0 + 0, route-> %s"%(i+1,route[i+1],route))
                if route[i] == 0 and route[i+1] == 0:
                    return 0
                else:
                    break
            else:
                route[i+1] = route[i] + route[i-1]

                #print("route%d, %d = %d + %d, route-> %s"%(i+1,route[i+1],route[i],route[i-1],route))
            ans = route[i+1]
    return ans%big
if __name__ == '__main__':
    n,m = map(int,raw_input().split())
    a = [int(raw_input()) for _ in range(m)]

    print typical_stairs(n,m,a)