#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline
MOD = 10**9+7
# @njit
def solve(n,stairs):
  # ～段目と対応
  dp = [1] + [0] * (n+1)
  dp[1] = stairs[1]
  for i in range(n):
    dp[i+2] = (dp[i] + dp[i+1]) * stairs[i+2]
    dp[i+2] %= MOD

  return dp[n]



def main():
  N,M = map(int,input().split())
  stairs = [1]*(N+10)
  for i in range(M):
    stairs[int(input())] = 0
  print(solve(N,stairs))
  return

if __name__ == '__main__':
  main() MOD = 10**9+7 MOD 10**9+7 10**9 10 9 7 def solve(n,stairs):
  # ～段目と対応
  dp = [1] + [0] * (n+1)
  dp[1] = stairs[1]
  for i in range(n):
    dp[i+2] = (dp[i] + dp[i+1]) * stairs[i+2]
    dp[i+2] %= MOD

  return dp[n] solve dp = [1] + [0] * (n+1) dp [1] + [0] * (n+1) [1] 1 [0] * (n+1) [0] 0 n+1 n 1 dp[1] = stairs[1] dp[1] dp 1 stairs[1] stairs 1 for i in range(n):
    dp[i+2] = (dp[i] + dp[i+1]) * stairs[i+2]
    dp[i+2] %= MOD

   i range(n) range n dp[i+2] = (dp[i] + dp[i+1]) * stairs[i+2] dp[i+2] dp i+2 i 2 (dp[i] + dp[i+1]) * stairs[i+2] dp[i] + dp[i+1] dp[i] dp i dp[i+1] dp i+1 i 1 stairs[i+2] stairs i+2 i 2 dp[i+2] %= MOD dp[i+2] dp i+2 i 2 MOD return dp[n] dp[n] dp n n n stairs stairs def main():
  N,M = map(int,input().split())
  stairs = [1]*(N+10)
  for i in range(M):
    stairs[int(input())] = 0
  print(solve(N,stairs))
  return main N,M = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M stairs = [1]*(N+10) stairs [1]*(N+10) [1] 1 N+10 N 10 for i in range(M):
    stairs[int(input())] = 0
   i range(M) range M stairs[int(input())] = 0 stairs[int(input())] stairs int(input()) int input() input 0 print(solve(N,stairs)) print solve(N,stairs) solve N stairs return if __name__ == '__main__':
  main() __name__ == '__main__' __name__ '__main__' main() main MOD = 10**9+7 10**9+7 MOD def solve(n,stairs):
  # ～段目と対応
  dp = [1] + [0] * (n+1)
  dp[1] = stairs[1]
  for i in range(n):
    dp[i+2] = (dp[i] + dp[i+1]) * stairs[i+2]
    dp[i+2] %= MOD

  return dp[n] def solve(n,stairs):
  # ～段目と対応
  dp = [1] + [0] * (n+1)
  dp[1] = stairs[1]
  for i in range(n):
    dp[i+2] = (dp[i] + dp[i+1]) * stairs[i+2]
    dp[i+2] %= MOD

  return dp[n] solve def main():
  N,M = map(int,input().split())
  stairs = [1]*(N+10)
  for i in range(M):
    stairs[int(input())] = 0
  print(solve(N,stairs))
  return def main():
  N,M = map(int,input().split())
  stairs = [1]*(N+10)
  for i in range(M):
    stairs[int(input())] = 0
  print(solve(N,stairs))
  return main
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline
MOD = 10**9+7
# @njit
def solve(n,stairs):
  # ～段目と対応
  dp = [1] + [0] * (n+1)
  dp[1] = stairs[1]
  for i in range(n):
    dp[i+2] = (dp[i] + dp[i+1]) * stairs[i+2]
    dp[i+2] %= MOD

  return dp[n]



def main():
  N,M = map(int,input().split())
  stairs = [1]*(N+10)
  for i in range(M):
    stairs[int(input())] = 0
  print(solve(N,stairs))
  return

if __name__ == '__main__':
  main()
