def abc129c():
    n, m = map(int, input().split())
    set_a = set()
    for _ in range(m):
        set_a.add(int(input()))
    dp = [0] * (n+1)
    dp[0] = 1
    for i in range(1, n+1):
        if i in set_a: continue
        dp[i] = dp[i-1]
        if i > 1:
            dp[i] += dp[i-2]
    print(dp[n]%1000000007)
abc129c() def abc129c():
    n, m = map(int, input().split())
    set_a = set()
    for _ in range(m):
        set_a.add(int(input()))
    dp = [0] * (n+1)
    dp[0] = 1
    for i in range(1, n+1):
        if i in set_a: continue
        dp[i] = dp[i-1]
        if i > 1:
            dp[i] += dp[i-2]
    print(dp[n]%1000000007) abc129c n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m set_a = set() set_a set() set for _ in range(m):
        set_a.add(int(input()))
     _ range(m) range m set_a.add(int(input())) set_a.add set_a add int(input()) int input() input dp = [0] * (n+1) dp [0] * (n+1) [0] 0 n+1 n 1 dp[0] = 1 dp[0] dp 0 1 for i in range(1, n+1):
        if i in set_a: continue
        dp[i] = dp[i-1]
        if i > 1:
            dp[i] += dp[i-2]
     i range(1, n+1) range 1 n+1 n 1 if i in set_a: continue
         i in set_a i set_a dp[i] = dp[i-1] dp[i] dp i dp[i-1] dp i-1 i 1 if i > 1:
            dp[i] += dp[i-2]
     i > 1 i 1 dp[i] += dp[i-2] dp[i] dp i dp[i-2] dp i-2 i 2 print(dp[n]%1000000007) print dp[n]%1000000007 dp[n] dp n 1000000007 abc129c() abc129c def abc129c():
    n, m = map(int, input().split())
    set_a = set()
    for _ in range(m):
        set_a.add(int(input()))
    dp = [0] * (n+1)
    dp[0] = 1
    for i in range(1, n+1):
        if i in set_a: continue
        dp[i] = dp[i-1]
        if i > 1:
            dp[i] += dp[i-2]
    print(dp[n]%1000000007) def abc129c():
    n, m = map(int, input().split())
    set_a = set()
    for _ in range(m):
        set_a.add(int(input()))
    dp = [0] * (n+1)
    dp[0] = 1
    for i in range(1, n+1):
        if i in set_a: continue
        dp[i] = dp[i-1]
        if i > 1:
            dp[i] += dp[i-2]
    print(dp[n]%1000000007) abc129c
def abc129c():
    n, m = map(int, input().split())
    set_a = set()
    for _ in range(m):
        set_a.add(int(input()))
    dp = [0] * (n+1)
    dp[0] = 1
    for i in range(1, n+1):
        if i in set_a: continue
        dp[i] = dp[i-1]
        if i > 1:
            dp[i] += dp[i-2]
    print(dp[n]%1000000007)
abc129c()