# coding:utf-8

import math

base = 1000000007

def main():
    n,m = map(int,raw_input().split())
    ms = []
    for i in range(m):
        ms.append(int(raw_input()))
    prev = -1
    for i in ms:
        if i - prev <= 1:
            print 0
            return
        prev = i
    prev = 0
    fib = 1
    fib1 = 0
    fib2 = 1
    cur = 0
    total = 1
    for i in range(0,n+1):
        if len(ms) > cur:
            curM = ms[cur]
            if i < curM:
                if cur >= 1 and i == ms[cur-1]:
                    continue
                fib = fib1 + fib2
                fib1 = fib2
                fib2 = fib
            else:
                total = (total * fib1) % base
                fib = 1
                fib1 = 0
                fib2 = 1
                cur += 1
        else:
            if cur >= 1 and i == ms[cur-1]:
                continue
            if i != n:
                fib = fib1 + fib2
                fib1 = fib2
                fib2 = fib
            else:
                total = (total * fib) % base
    print total

if __name__ == "__main__":
    main()

