#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C
# CreatedDate:  2020-08-22 13:23:10 +0900
# LastModified: 2020-08-22 13:37:55 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n, m = map(int, input().split())
    stairs = [0]*(n+1)
    stairs[0] = 1
    for _ in range(m):
        a = int(input())
        stairs[a] = -1
    for i in range(n-1):
        if stairs[i] == -1:
            continue

        if stairs[i+1] == -1:
            pass
        else:
            stairs[i+1] += stairs[i]

        if stairs[i+2] == -1:
            pass
        else:
            stairs[i+2] += stairs[i]
    if stairs[n-1] != -1:
        print((stairs[n-1]+stairs[n])%1000000007)
    else:
        print(stairs[n]%1000000007)


if __name__ == "__main__":
    main() import os os import sys sys def main():
    n, m = map(int, input().split())
    stairs = [0]*(n+1)
    stairs[0] = 1
    for _ in range(m):
        a = int(input())
        stairs[a] = -1
    for i in range(n-1):
        if stairs[i] == -1:
            continue

        if stairs[i+1] == -1:
            pass
        else:
            stairs[i+1] += stairs[i]

        if stairs[i+2] == -1:
            pass
        else:
            stairs[i+2] += stairs[i]
    if stairs[n-1] != -1:
        print((stairs[n-1]+stairs[n])%1000000007)
    else:
        print(stairs[n]%1000000007) main n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m stairs = [0]*(n+1) stairs [0]*(n+1) [0] 0 n+1 n 1 stairs[0] = 1 stairs[0] stairs 0 1 for _ in range(m):
        a = int(input())
        stairs[a] = -1
     _ range(m) range m a = int(input()) a int(input()) int input() input stairs[a] = -1 stairs[a] stairs a -1 for i in range(n-1):
        if stairs[i] == -1:
            continue

        if stairs[i+1] == -1:
            pass
        else:
            stairs[i+1] += stairs[i]

        if stairs[i+2] == -1:
            pass
        else:
            stairs[i+2] += stairs[i]
     i range(n-1) range n-1 n 1 if stairs[i] == -1:
            continue

         stairs[i] == -1 stairs[i] stairs i -1 continue if stairs[i+1] == -1:
            pass
        else:
            stairs[i+1] += stairs[i]

         stairs[i+1] == -1 stairs[i+1] stairs i+1 i 1 -1 stairs[i+1] += stairs[i] stairs[i+1] stairs i+1 i 1 stairs[i] stairs i if stairs[i+2] == -1:
            pass
        else:
            stairs[i+2] += stairs[i]
     stairs[i+2] == -1 stairs[i+2] stairs i+2 i 2 -1 stairs[i+2] += stairs[i] stairs[i+2] stairs i+2 i 2 stairs[i] stairs i if stairs[n-1] != -1:
        print((stairs[n-1]+stairs[n])%1000000007)
    else:
        print(stairs[n]%1000000007) stairs[n-1] != -1 stairs[n-1] stairs n-1 n 1 -1 print((stairs[n-1]+stairs[n])%1000000007) print (stairs[n-1]+stairs[n])%1000000007 stairs[n-1]+stairs[n] stairs[n-1] stairs n-1 n 1 stairs[n] stairs n 1000000007 print(stairs[n]%1000000007) print stairs[n]%1000000007 stairs[n] stairs n 1000000007 if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n, m = map(int, input().split())
    stairs = [0]*(n+1)
    stairs[0] = 1
    for _ in range(m):
        a = int(input())
        stairs[a] = -1
    for i in range(n-1):
        if stairs[i] == -1:
            continue

        if stairs[i+1] == -1:
            pass
        else:
            stairs[i+1] += stairs[i]

        if stairs[i+2] == -1:
            pass
        else:
            stairs[i+2] += stairs[i]
    if stairs[n-1] != -1:
        print((stairs[n-1]+stairs[n])%1000000007)
    else:
        print(stairs[n]%1000000007) def main():
    n, m = map(int, input().split())
    stairs = [0]*(n+1)
    stairs[0] = 1
    for _ in range(m):
        a = int(input())
        stairs[a] = -1
    for i in range(n-1):
        if stairs[i] == -1:
            continue

        if stairs[i+1] == -1:
            pass
        else:
            stairs[i+1] += stairs[i]

        if stairs[i+2] == -1:
            pass
        else:
            stairs[i+2] += stairs[i]
    if stairs[n-1] != -1:
        print((stairs[n-1]+stairs[n])%1000000007)
    else:
        print(stairs[n]%1000000007) main
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C
# CreatedDate:  2020-08-22 13:23:10 +0900
# LastModified: 2020-08-22 13:37:55 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n, m = map(int, input().split())
    stairs = [0]*(n+1)
    stairs[0] = 1
    for _ in range(m):
        a = int(input())
        stairs[a] = -1
    for i in range(n-1):
        if stairs[i] == -1:
            continue

        if stairs[i+1] == -1:
            pass
        else:
            stairs[i+1] += stairs[i]

        if stairs[i+2] == -1:
            pass
        else:
            stairs[i+2] += stairs[i]
    if stairs[n-1] != -1:
        print((stairs[n-1]+stairs[n])%1000000007)
    else:
        print(stairs[n]%1000000007)


if __name__ == "__main__":
    main()
