import math
import sys
import collections
import bisect
readline = sys.stdin.readline


def main():
    n, m = map(int, readline().rstrip().split())
    A = [-1] + [int(readline().rstrip()) for _ in range(m)] + [n + 1]
    num = 10 ** 5 + 10
    # num = 10
    aList = [0] * (num)
    aList[0] = 1
    aList[1] = 1
    aList[2] = 2
    for i in range(3, num):
        aList[i] = aList[i - 1] + aList[i - 2]
    sumA = 1
    for j in range(m + 1):
        if A[j + 1] - 1 == A[j]:
            print(0)
            return
        sumA = (sumA * aList[(A[j + 1] - 1) - (A[j] + 1)]) % (10 ** 9 + 7)
    print(sumA)


if __name__ == '__main__':
    main() import math math import sys sys import collections collections import bisect bisect readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline def main():
    n, m = map(int, readline().rstrip().split())
    A = [-1] + [int(readline().rstrip()) for _ in range(m)] + [n + 1]
    num = 10 ** 5 + 10
    # num = 10
    aList = [0] * (num)
    aList[0] = 1
    aList[1] = 1
    aList[2] = 2
    for i in range(3, num):
        aList[i] = aList[i - 1] + aList[i - 2]
    sumA = 1
    for j in range(m + 1):
        if A[j + 1] - 1 == A[j]:
            print(0)
            return
        sumA = (sumA * aList[(A[j + 1] - 1) - (A[j] + 1)]) % (10 ** 9 + 7)
    print(sumA) main n, m = map(int, readline().rstrip().split()) n map(int, readline().rstrip().split()) map int readline().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () readline rstrip split m int(readline().rstrip()) for _ in range(m) for _ in range(m) _ range(m) range m for _ in range(m) int(readline().rstrip()) int readline().rstrip() ().rstrip () readline rstrip A = [-1] + [int(readline().rstrip()) for _ in range(m)] + [n + 1] A [-1] + [int(readline().rstrip()) for _ in range(m)] + [n + 1] [-1] + [int(readline().rstrip()) for _ in range(m)] [-1] -1 [int(readline().rstrip()) for _ in range(m)] [n + 1] n + 1 n 1 num = 10 ** 5 + 10 num 10 ** 5 + 10 10 ** 5 10 5 10 aList = [0] * (num) aList [0] * (num) [0] 0 num aList[0] = 1 aList[0] aList 0 1 aList[1] = 1 aList[1] aList 1 1 aList[2] = 2 aList[2] aList 2 2 for i in range(3, num):
        aList[i] = aList[i - 1] + aList[i - 2]
     i range(3, num) range 3 num aList[i] = aList[i - 1] + aList[i - 2] aList[i] aList i aList[i - 1] + aList[i - 2] aList[i - 1] aList i - 1 i 1 aList[i - 2] aList i - 2 i 2 sumA = 1 sumA 1 for j in range(m + 1):
        if A[j + 1] - 1 == A[j]:
            print(0)
            return
        sumA = (sumA * aList[(A[j + 1] - 1) - (A[j] + 1)]) % (10 ** 9 + 7)
     j range(m + 1) range m + 1 m 1 if A[j + 1] - 1 == A[j]:
            print(0)
            return
         A[j + 1] - 1 == A[j] A[j + 1] - 1 A[j + 1] A j + 1 j 1 1 A[j] A j print(0) print 0 return sumA = (sumA * aList[(A[j + 1] - 1) - (A[j] + 1)]) % (10 ** 9 + 7) sumA (sumA * aList[(A[j + 1] - 1) - (A[j] + 1)]) % (10 ** 9 + 7) sumA * aList[(A[j + 1] - 1) - (A[j] + 1)] sumA aList[(A[j + 1] - 1) - (A[j] + 1)] aList (A[j + 1] - 1) - (A[j] + 1) A[j + 1] - 1 A[j + 1] A j + 1 j 1 1 A[j] + 1 A[j] A j 1 10 ** 9 + 7 10 ** 9 10 9 7 print(sumA) print sumA if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n, m = map(int, readline().rstrip().split())
    A = [-1] + [int(readline().rstrip()) for _ in range(m)] + [n + 1]
    num = 10 ** 5 + 10
    # num = 10
    aList = [0] * (num)
    aList[0] = 1
    aList[1] = 1
    aList[2] = 2
    for i in range(3, num):
        aList[i] = aList[i - 1] + aList[i - 2]
    sumA = 1
    for j in range(m + 1):
        if A[j + 1] - 1 == A[j]:
            print(0)
            return
        sumA = (sumA * aList[(A[j + 1] - 1) - (A[j] + 1)]) % (10 ** 9 + 7)
    print(sumA) def main():
    n, m = map(int, readline().rstrip().split())
    A = [-1] + [int(readline().rstrip()) for _ in range(m)] + [n + 1]
    num = 10 ** 5 + 10
    # num = 10
    aList = [0] * (num)
    aList[0] = 1
    aList[1] = 1
    aList[2] = 2
    for i in range(3, num):
        aList[i] = aList[i - 1] + aList[i - 2]
    sumA = 1
    for j in range(m + 1):
        if A[j + 1] - 1 == A[j]:
            print(0)
            return
        sumA = (sumA * aList[(A[j + 1] - 1) - (A[j] + 1)]) % (10 ** 9 + 7)
    print(sumA) main readline = sys.stdin.readline sys.stdin.readline readline
import math
import sys
import collections
import bisect
readline = sys.stdin.readline


def main():
    n, m = map(int, readline().rstrip().split())
    A = [-1] + [int(readline().rstrip()) for _ in range(m)] + [n + 1]
    num = 10 ** 5 + 10
    # num = 10
    aList = [0] * (num)
    aList[0] = 1
    aList[1] = 1
    aList[2] = 2
    for i in range(3, num):
        aList[i] = aList[i - 1] + aList[i - 2]
    sumA = 1
    for j in range(m + 1):
        if A[j + 1] - 1 == A[j]:
            print(0)
            return
        sumA = (sumA * aList[(A[j + 1] - 1) - (A[j] + 1)]) % (10 ** 9 + 7)
    print(sumA)


if __name__ == '__main__':
    main()
