
url = "https://atcoder.jp//contests/abc129/tasks/abc129_c"

def main():
    n, m = list(map(int, input().split()))
    isbreak = [False] * (n+1)
    for _ in range(m):
        isbreak[int(input())] = True

    dp = [0] * (n + 1)
    dp[0] = 1
    for i in range(n):
        for j in range(i+1, min(i+3, n+1)):
            if not isbreak[j]:
                dp[j] += dp[i]
                dp[j] %= 1000000007
    print(dp[-1])




if __name__ == '__main__':
    main() url = "https://atcoder.jp//contests/abc129/tasks/abc129_c" url "https://atcoder.jp//contests/abc129/tasks/abc129_c" def main():
    n, m = list(map(int, input().split()))
    isbreak = [False] * (n+1)
    for _ in range(m):
        isbreak[int(input())] = True

    dp = [0] * (n + 1)
    dp[0] = 1
    for i in range(n):
        for j in range(i+1, min(i+3, n+1)):
            if not isbreak[j]:
                dp[j] += dp[i]
                dp[j] %= 1000000007
    print(dp[-1]) main n, m = list(map(int, input().split())) n list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split m isbreak = [False] * (n+1) isbreak [False] * (n+1) [False] False n+1 n 1 for _ in range(m):
        isbreak[int(input())] = True

     _ range(m) range m isbreak[int(input())] = True isbreak[int(input())] isbreak int(input()) int input() input True 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(n):
        for j in range(i+1, min(i+3, n+1)):
            if not isbreak[j]:
                dp[j] += dp[i]
                dp[j] %= 1000000007
     i range(n) range n for j in range(i+1, min(i+3, n+1)):
            if not isbreak[j]:
                dp[j] += dp[i]
                dp[j] %= 1000000007
     j range(i+1, min(i+3, n+1)) range i+1 i 1 min(i+3, n+1) min i+3 i 3 n+1 n 1 if not isbreak[j]:
                dp[j] += dp[i]
                dp[j] %= 1000000007
     not isbreak[j] isbreak[j] isbreak j dp[j] += dp[i] dp[j] dp j dp[i] dp i dp[j] %= 1000000007 dp[j] dp j 1000000007 print(dp[-1]) print dp[-1] dp -1 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main url = "https://atcoder.jp//contests/abc129/tasks/abc129_c" "https://atcoder.jp//contests/abc129/tasks/abc129_c" url def main():
    n, m = list(map(int, input().split()))
    isbreak = [False] * (n+1)
    for _ in range(m):
        isbreak[int(input())] = True

    dp = [0] * (n + 1)
    dp[0] = 1
    for i in range(n):
        for j in range(i+1, min(i+3, n+1)):
            if not isbreak[j]:
                dp[j] += dp[i]
                dp[j] %= 1000000007
    print(dp[-1]) def main():
    n, m = list(map(int, input().split()))
    isbreak = [False] * (n+1)
    for _ in range(m):
        isbreak[int(input())] = True

    dp = [0] * (n + 1)
    dp[0] = 1
    for i in range(n):
        for j in range(i+1, min(i+3, n+1)):
            if not isbreak[j]:
                dp[j] += dp[i]
                dp[j] %= 1000000007
    print(dp[-1]) main

url = "https://atcoder.jp//contests/abc129/tasks/abc129_c"

def main():
    n, m = list(map(int, input().split()))
    isbreak = [False] * (n+1)
    for _ in range(m):
        isbreak[int(input())] = True

    dp = [0] * (n + 1)
    dp[0] = 1
    for i in range(n):
        for j in range(i+1, min(i+3, n+1)):
            if not isbreak[j]:
                dp[j] += dp[i]
                dp[j] %= 1000000007
    print(dp[-1])




if __name__ == '__main__':
    main()
