BASE =  1000000007

class Counter(object):
    def __init__(self):
        self.counter = []
    def append(self, elem):
        self.counter.append(elem)
    def getCount(self, idx):
        pass

if __name__ == '__main__':
    N, M = [int(i) for i in input().split()]
    not_available = set()
    for i in range(M):
        not_available.add(int(input()))
    x = 0
    y = 1
    predicted_next = 1
    available = {i + 1 for i in range(N)} - not_available
    for elem in available:
        if predicted_next + 2 <= elem:
            y = 0
            break
        elif predicted_next + 1 == elem:
            x = 0
            predicted_next = elem + 2
        else:
            z = x + y
            x = y
            y = z
            predicted_next = elem + 1
    print(y % BASE)