# n = int(sys.stdin.readline())

# a, b = map(int, sys.stdin.readline().split())

# c = list(map(int, sys.stdin.readline().split()))

# s = [list(map(int,list(sys.stdin.readline()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき



# a = 100

# b = 0.987654321

# print('{0:06d}-{1:6f}'.format(a,b))  # 0埋め, 小数点出力桁指定時のときの出力

# 000100-0.987654



import math

import sys

import itertools

import queue



mod = 1000000007



if __name__ == "__main__":

    N, M = list(map(int, sys.stdin.readline().split()))



    broken = [False for _ in range(N + 2)]

    for _ in range(M):

        broken[int(sys.stdin.readline())] = True



    dp = [0 for _ in range(N + 2)]

    dp[N] = 1

    for i in range(0, N)[::-1]:

        if not broken[i]:

            dp[i] = dp[i + 1] + dp[i + 2]

    print((dp[0] % mod))
# n = int(sys.stdin.readline())

# a, b = map(int, sys.stdin.readline().split())

# c = list(map(int, sys.stdin.readline().split()))

# s = [list(map(int,list(sys.stdin.readline()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき



# a = 100

# b = 0.987654321

# print('{0:06d}-{1:6f}'.format(a,b))  # 0埋め, 小数点出力桁指定時のときの出力

# 000100-0.987654



import math

import sys

import itertools

import queue



mod = 1000000007



if __name__ == "__main__":

    N, M = list(map(int, sys.stdin.readline().split()))



    broken = [False for _ in range(N + 2)]

    for _ in range(M):

        broken[int(sys.stdin.readline())] = True



    dp = [0 for _ in range(N + 2)]

    dp[N] = 1

    for i in range(0, N)[::-1]:

        if not broken[i]:

            dp[i] = (dp[i + 1] + dp[i + 2]) % mod

    print((dp[0]))
# n = int(sys.stdin.readline())
# a, b = map(int, sys.stdin.readline().split())
# c = list(map(int, sys.stdin.readline().split()))
# s = [list(map(int,list(sys.stdin.readline()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき
# a = 100
# b = 0.987654321
# print('{0:06d}-{1:6f}'.format(a,b))  # 0埋め, 小数点出力桁指定時のときの出力
# 000100-0.987654
import math
import sys
import itertools
import queue

mod = 1000000007
if __name__ == "__main__":
    N, M = list(map(int, sys.stdin.readline().split()))
    broken = [False for _ in range(N + 2)]
    for _ in range(M):
        broken[int(sys.stdin.readline())] = True
    dp = [0 for _ in range(N + 2)]
    dp[N] = 1
    for i in range(0, N)[::-1]:
        if not broken[i]:
            dp[i] = dp[i + 1] + dp[i + 2]
    print((dp[0] % mod))

# n = int(sys.stdin.readline())
# a, b = map(int, sys.stdin.readline().split())
# c = list(map(int, sys.stdin.readline().split()))
# s = [list(map(int,list(sys.stdin.readline()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき
# a = 100
# b = 0.987654321
# print('{0:06d}-{1:6f}'.format(a,b))  # 0埋め, 小数点出力桁指定時のときの出力
# 000100-0.987654
import math
import sys
import itertools
import queue

mod = 1000000007
if __name__ == "__main__":
    N, M = list(map(int, sys.stdin.readline().split()))
    broken = [False for _ in range(N + 2)]
    for _ in range(M):
        broken[int(sys.stdin.readline())] = True
    dp = [0 for _ in range(N + 2)]
    dp[N] = 1
    for i in range(0, N)[::-1]:
        if not broken[i]:
            dp[i] = (dp[i + 1] + dp[i + 2]) % mod
    print((dp[0]))

-            dp[i] = dp[i + 1] + dp[i + 2] -    print((dp[0] % mod)) +            dp[i] = (dp[i + 1] + dp[i + 2]) % mod +    print((dp[0]))