def resolve():
    '''
    code here
    '''
    from functools import lru_cache
    import sys
    sys.setrecursionlimit(10**6)

    N, M = [int(item) for item in input().split()]
    As = [int(input()) for _ in range(M)]
    memo = [False for _ in range(N+1)]

    for item in As:
        memo[item] = True

    res_list = []

    prev = 0
    for i in range(1,N+1):
        if memo[i] == True:
            res_list.append(i-1 - prev)
            prev = i+1
    else:
        if memo[N] == False and memo[N] == False:
            res_list.append(N - prev)

    @lru_cache
    def cal(num):
        if 0 <= num <= 1:
            return 1
        elif num == -1:
            return 0
        else:
            return cal(num-1) + cal(num-2)
    # print(res_list)
    res = 1
    for item in res_list:
        res *= cal(item)% (10**9 + 7)

    print(res % (10**9 + 7))



if __name__ == "__main__":
    resolve() def resolve():
    '''
    code here
    '''
    from functools import lru_cache
    import sys
    sys.setrecursionlimit(10**6)

    N, M = [int(item) for item in input().split()]
    As = [int(input()) for _ in range(M)]
    memo = [False for _ in range(N+1)]

    for item in As:
        memo[item] = True

    res_list = []

    prev = 0
    for i in range(1,N+1):
        if memo[i] == True:
            res_list.append(i-1 - prev)
            prev = i+1
    else:
        if memo[N] == False and memo[N] == False:
            res_list.append(N - prev)

    @lru_cache
    def cal(num):
        if 0 <= num <= 1:
            return 1
        elif num == -1:
            return 0
        else:
            return cal(num-1) + cal(num-2)
    # print(res_list)
    res = 1
    for item in res_list:
        res *= cal(item)% (10**9 + 7)

    print(res % (10**9 + 7)) resolve '''
    code here
    ''' from functools import lru_cache import sys sys sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 int(item) for item in input().split() for item in input().split() item input().split() ().split () input split for item in input().split() int(item) int item N, M = [int(item) for item in input().split()] N [int(item) for item in input().split()] M int(input()) for _ in range(M) for _ in range(M) _ range(M) range M for _ in range(M) int(input()) int input() input As = [int(input()) for _ in range(M)] As [int(input()) for _ in range(M)] False for _ in range(N+1) for _ in range(N+1) _ range(N+1) range N+1 N 1 for _ in range(N+1) False memo = [False for _ in range(N+1)] memo [False for _ in range(N+1)] for item in As:
        memo[item] = True

     item As memo[item] = True memo[item] memo item True res_list = [] res_list [] prev = 0 prev 0 for i in range(1,N+1):
        if memo[i] == True:
            res_list.append(i-1 - prev)
            prev = i+1
    else:
        if memo[N] == False and memo[N] == False:
            res_list.append(N - prev)

     i range(1,N+1) range 1 N+1 N 1 if memo[i] == True:
            res_list.append(i-1 - prev)
            prev = i+1
     memo[i] == True memo[i] memo i True res_list.append(i-1 - prev) res_list.append res_list append i-1 - prev i-1 i 1 prev prev = i+1 prev i+1 i 1 if memo[N] == False and memo[N] == False:
            res_list.append(N - prev)

     memo[N] == False and memo[N] == False memo[N] == False memo[N] memo N False memo[N] == False memo[N] memo N False res_list.append(N - prev) res_list.append res_list append N - prev N prev def cal(num):
        if 0 <= num <= 1:
            return 1
        elif num == -1:
            return 0
        else:
            return cal(num-1) + cal(num-2)
    # print(res_list)
     cal if 0 <= num <= 1:
            return 1
        elif num == -1:
            return 0
        else:
            return cal(num-1) + cal(num-2)
    # print(res_list)
     0 <= num <= 1 0 <= num 0 num 1 return 1 1 elif num == -1:
            return 0
         num == -1 num -1 return 0 0 return cal(num-1) + cal(num-2) cal(num-1) + cal(num-2) cal(num-1) cal num-1 num 1 cal(num-2) cal num-2 num 2 num num @lru_cache
     cal lru_cache cal res = 1 res 1 for item in res_list:
        res *= cal(item)% (10**9 + 7)

     item res_list res *= cal(item)% (10**9 + 7) res cal(item)% (10**9 + 7) cal(item) cal item 10**9 + 7 10**9 10 9 7 print(res % (10**9 + 7)) print res % (10**9 + 7) res 10**9 + 7 10**9 10 9 7 if __name__ == "__main__":
    resolve() __name__ == "__main__" __name__ "__main__" resolve() resolve def resolve():
    '''
    code here
    '''
    from functools import lru_cache
    import sys
    sys.setrecursionlimit(10**6)

    N, M = [int(item) for item in input().split()]
    As = [int(input()) for _ in range(M)]
    memo = [False for _ in range(N+1)]

    for item in As:
        memo[item] = True

    res_list = []

    prev = 0
    for i in range(1,N+1):
        if memo[i] == True:
            res_list.append(i-1 - prev)
            prev = i+1
    else:
        if memo[N] == False and memo[N] == False:
            res_list.append(N - prev)

    @lru_cache
    def cal(num):
        if 0 <= num <= 1:
            return 1
        elif num == -1:
            return 0
        else:
            return cal(num-1) + cal(num-2)
    # print(res_list)
    res = 1
    for item in res_list:
        res *= cal(item)% (10**9 + 7)

    print(res % (10**9 + 7)) def resolve():
    '''
    code here
    '''
    from functools import lru_cache
    import sys
    sys.setrecursionlimit(10**6)

    N, M = [int(item) for item in input().split()]
    As = [int(input()) for _ in range(M)]
    memo = [False for _ in range(N+1)]

    for item in As:
        memo[item] = True

    res_list = []

    prev = 0
    for i in range(1,N+1):
        if memo[i] == True:
            res_list.append(i-1 - prev)
            prev = i+1
    else:
        if memo[N] == False and memo[N] == False:
            res_list.append(N - prev)

    @lru_cache
    def cal(num):
        if 0 <= num <= 1:
            return 1
        elif num == -1:
            return 0
        else:
            return cal(num-1) + cal(num-2)
    # print(res_list)
    res = 1
    for item in res_list:
        res *= cal(item)% (10**9 + 7)

    print(res % (10**9 + 7)) resolve
def resolve():
    '''
    code here
    '''
    from functools import lru_cache
    import sys
    sys.setrecursionlimit(10**6)

    N, M = [int(item) for item in input().split()]
    As = [int(input()) for _ in range(M)]
    memo = [False for _ in range(N+1)]

    for item in As:
        memo[item] = True

    res_list = []

    prev = 0
    for i in range(1,N+1):
        if memo[i] == True:
            res_list.append(i-1 - prev)
            prev = i+1
    else:
        if memo[N] == False and memo[N] == False:
            res_list.append(N - prev)

    @lru_cache
    def cal(num):
        if 0 <= num <= 1:
            return 1
        elif num == -1:
            return 0
        else:
            return cal(num-1) + cal(num-2)
    # print(res_list)
    res = 1
    for item in res_list:
        res *= cal(item)% (10**9 + 7)

    print(res % (10**9 + 7))



if __name__ == "__main__":
    resolve()
