import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools
from collections import Counter

def main():
    n,m = map(int, input().split())
    dp = [0]*(n+1)
    dp[0] = 1
    a = [int(input()) for _ in range(m)]
    b = [1]*(n+1)

    for i in range(m):
        b[a[i]] = 0
    for i in range(n):
        if i - 1 >= 0:
            dp[i+1] = dp[i]*b[i]+dp[i-1]*b[i-1]
        else:
            dp[i+1] = dp[i]*b[i]
        dp[i+1] %= 10**9+7
    print(dp[n])

if __name__=="__main__":
    main() import math math from math import gcd INF = float("inf") INF float("inf") float "inf" import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline import itertools itertools from collections import Counter def main():
    n,m = map(int, input().split())
    dp = [0]*(n+1)
    dp[0] = 1
    a = [int(input()) for _ in range(m)]
    b = [1]*(n+1)

    for i in range(m):
        b[a[i]] = 0
    for i in range(n):
        if i - 1 >= 0:
            dp[i+1] = dp[i]*b[i]+dp[i-1]*b[i-1]
        else:
            dp[i+1] = dp[i]*b[i]
        dp[i+1] %= 10**9+7
    print(dp[n]) main n,m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m dp = [0]*(n+1) dp [0]*(n+1) [0] 0 n+1 n 1 dp[0] = 1 dp[0] dp 0 1 int(input()) for _ in range(m) for _ in range(m) _ range(m) range m for _ in range(m) int(input()) int input() input a = [int(input()) for _ in range(m)] a [int(input()) for _ in range(m)] b = [1]*(n+1) b [1]*(n+1) [1] 1 n+1 n 1 for i in range(m):
        b[a[i]] = 0
     i range(m) range m b[a[i]] = 0 b[a[i]] b a[i] a i 0 for i in range(n):
        if i - 1 >= 0:
            dp[i+1] = dp[i]*b[i]+dp[i-1]*b[i-1]
        else:
            dp[i+1] = dp[i]*b[i]
        dp[i+1] %= 10**9+7
     i range(n) range n if i - 1 >= 0:
            dp[i+1] = dp[i]*b[i]+dp[i-1]*b[i-1]
        else:
            dp[i+1] = dp[i]*b[i]
         i - 1 >= 0 i - 1 i 1 0 dp[i+1] = dp[i]*b[i]+dp[i-1]*b[i-1] dp[i+1] dp i+1 i 1 dp[i]*b[i]+dp[i-1]*b[i-1] dp[i]*b[i] dp[i] dp i b[i] b i dp[i-1]*b[i-1] dp[i-1] dp i-1 i 1 b[i-1] b i-1 i 1 dp[i+1] = dp[i]*b[i] dp[i+1] dp i+1 i 1 dp[i]*b[i] dp[i] dp i b[i] b i dp[i+1] %= 10**9+7 dp[i+1] dp i+1 i 1 10**9+7 10**9 10 9 7 print(dp[n]) print dp[n] dp n if __name__=="__main__":
    main() __name__=="__main__" __name__ "__main__" main() main input=sys.stdin.readline sys.stdin.readline input INF = float("inf") float("inf") INF def main():
    n,m = map(int, input().split())
    dp = [0]*(n+1)
    dp[0] = 1
    a = [int(input()) for _ in range(m)]
    b = [1]*(n+1)

    for i in range(m):
        b[a[i]] = 0
    for i in range(n):
        if i - 1 >= 0:
            dp[i+1] = dp[i]*b[i]+dp[i-1]*b[i-1]
        else:
            dp[i+1] = dp[i]*b[i]
        dp[i+1] %= 10**9+7
    print(dp[n]) def main():
    n,m = map(int, input().split())
    dp = [0]*(n+1)
    dp[0] = 1
    a = [int(input()) for _ in range(m)]
    b = [1]*(n+1)

    for i in range(m):
        b[a[i]] = 0
    for i in range(n):
        if i - 1 >= 0:
            dp[i+1] = dp[i]*b[i]+dp[i-1]*b[i-1]
        else:
            dp[i+1] = dp[i]*b[i]
        dp[i+1] %= 10**9+7
    print(dp[n]) main
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools
from collections import Counter

def main():
    n,m = map(int, input().split())
    dp = [0]*(n+1)
    dp[0] = 1
    a = [int(input()) for _ in range(m)]
    b = [1]*(n+1)

    for i in range(m):
        b[a[i]] = 0
    for i in range(n):
        if i - 1 >= 0:
            dp[i+1] = dp[i]*b[i]+dp[i-1]*b[i-1]
        else:
            dp[i+1] = dp[i]*b[i]
        dp[i+1] %= 10**9+7
    print(dp[n])

if __name__=="__main__":
    main()
