import sys

input = sys.stdin.readline

P = 10 ** 9 + 7


def main():
    N, M = map(int, input().split())
    A = [0] * M
    for i in range(M):
        A[i] = int(input())

    for i in range(M - 1):
        if A[i] + 1 == A[i + 1]:
            print(0)
            exit()

    broken = [False] * (N + 1)
    for a in A:
        broken[a] = True

    dp = [0] * (N + 1)
    dp[0] = 1
    dp[1] = 1 if not broken[1] else 0

    for i in range(2, N + 1):
        if broken[i]:
            dp[i] = 0
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % P
    
    ans = dp[N]
    print(ans)


if __name__ == "__main__":
    main() import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline P = 10 ** 9 + 7 P 10 ** 9 + 7 10 ** 9 10 9 7 def main():
    N, M = map(int, input().split())
    A = [0] * M
    for i in range(M):
        A[i] = int(input())

    for i in range(M - 1):
        if A[i] + 1 == A[i + 1]:
            print(0)
            exit()

    broken = [False] * (N + 1)
    for a in A:
        broken[a] = True

    dp = [0] * (N + 1)
    dp[0] = 1
    dp[1] = 1 if not broken[1] else 0

    for i in range(2, N + 1):
        if broken[i]:
            dp[i] = 0
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % P
    
    ans = dp[N]
    print(ans) main N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M A = [0] * M A [0] * M [0] 0 M for i in range(M):
        A[i] = int(input())

     i range(M) range M A[i] = int(input()) A[i] A i int(input()) int input() input for i in range(M - 1):
        if A[i] + 1 == A[i + 1]:
            print(0)
            exit()

     i range(M - 1) range M - 1 M 1 if A[i] + 1 == A[i + 1]:
            print(0)
            exit()

     A[i] + 1 == A[i + 1] A[i] + 1 A[i] A i 1 A[i + 1] A i + 1 i 1 print(0) print 0 exit() exit broken = [False] * (N + 1) broken [False] * (N + 1) [False] False N + 1 N 1 for a in A:
        broken[a] = True

     a A broken[a] = True broken[a] broken a True dp = [0] * (N + 1) dp [0] * (N + 1) [0] 0 N + 1 N 1 dp[0] = 1 dp[0] dp 0 1 dp[1] = 1 if not broken[1] else 0 dp[1] dp 1 1 if not broken[1] else 0 not broken[1] broken[1] broken 1 1 0 for i in range(2, N + 1):
        if broken[i]:
            dp[i] = 0
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % P
    
     i range(2, N + 1) range 2 N + 1 N 1 if broken[i]:
            dp[i] = 0
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % P
    
     broken[i] broken i dp[i] = 0 dp[i] dp i 0 dp[i] = (dp[i - 1] + dp[i - 2]) % P dp[i] dp i (dp[i - 1] + dp[i - 2]) % P dp[i - 1] + dp[i - 2] dp[i - 1] dp i - 1 i 1 dp[i - 2] dp i - 2 i 2 P ans = dp[N] ans dp[N] dp N print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N, M = map(int, input().split())
    A = [0] * M
    for i in range(M):
        A[i] = int(input())

    for i in range(M - 1):
        if A[i] + 1 == A[i + 1]:
            print(0)
            exit()

    broken = [False] * (N + 1)
    for a in A:
        broken[a] = True

    dp = [0] * (N + 1)
    dp[0] = 1
    dp[1] = 1 if not broken[1] else 0

    for i in range(2, N + 1):
        if broken[i]:
            dp[i] = 0
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % P
    
    ans = dp[N]
    print(ans) def main():
    N, M = map(int, input().split())
    A = [0] * M
    for i in range(M):
        A[i] = int(input())

    for i in range(M - 1):
        if A[i] + 1 == A[i + 1]:
            print(0)
            exit()

    broken = [False] * (N + 1)
    for a in A:
        broken[a] = True

    dp = [0] * (N + 1)
    dp[0] = 1
    dp[1] = 1 if not broken[1] else 0

    for i in range(2, N + 1):
        if broken[i]:
            dp[i] = 0
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % P
    
    ans = dp[N]
    print(ans) main input = sys.stdin.readline sys.stdin.readline input P = 10 ** 9 + 7 10 ** 9 + 7 P
import sys

input = sys.stdin.readline

P = 10 ** 9 + 7


def main():
    N, M = map(int, input().split())
    A = [0] * M
    for i in range(M):
        A[i] = int(input())

    for i in range(M - 1):
        if A[i] + 1 == A[i + 1]:
            print(0)
            exit()

    broken = [False] * (N + 1)
    for a in A:
        broken[a] = True

    dp = [0] * (N + 1)
    dp[0] = 1
    dp[1] = 1 if not broken[1] else 0

    for i in range(2, N + 1):
        if broken[i]:
            dp[i] = 0
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % P
    
    ans = dp[N]
    print(ans)


if __name__ == "__main__":
    main()
