N, M = map(int, input().split())

nums = [1, 2]
for i in range(2, N+1):
  plus = nums[i-2] + nums[i-1]
  nums.append(plus)
  
stairs = [0]*N
stairs[0] = 1
stairs.append(1)
flag = True
for i in range(M):
  m = int(input())
  if stairs[m] == 1:
    flag = False
    break
  else:
    stairs[m-1], stairs[m], stairs[m+1] = 1, 1, 1
  
ans = 1
mode = False
left = -1
right = -1
for i in range(N+1):
  if stairs[i] == 0:
    if not mode:
      left = i
      mode = True
  else:
    if mode:
      right = i
      n = right - left
      ans *= nums[n]
      mode = False
      
if flag:
  print(ans%(10**9+7))
else:
  print(0) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M nums = [1, 2] nums [1, 2] 1 2 for i in range(2, N+1):
  plus = nums[i-2] + nums[i-1]
  nums.append(plus)
   i range(2, N+1) range 2 N+1 N 1 plus = nums[i-2] + nums[i-1] plus nums[i-2] + nums[i-1] nums[i-2] nums i-2 i 2 nums[i-1] nums i-1 i 1 nums.append(plus) nums.append nums append plus stairs = [0]*N stairs [0]*N [0] 0 N stairs[0] = 1 stairs[0] stairs 0 1 stairs.append(1) stairs.append stairs append 1 flag = True flag True for i in range(M):
  m = int(input())
  if stairs[m] == 1:
    flag = False
    break
  else:
    stairs[m-1], stairs[m], stairs[m+1] = 1, 1, 1
   i range(M) range M m = int(input()) m int(input()) int input() input if stairs[m] == 1:
    flag = False
    break
  else:
    stairs[m-1], stairs[m], stairs[m+1] = 1, 1, 1
   stairs[m] == 1 stairs[m] stairs m 1 flag = False flag False break stairs[m-1], stairs[m], stairs[m+1] = 1, 1, 1 stairs[m-1] stairs m-1 m 1 1 stairs[m] stairs m 1 stairs[m+1] stairs m+1 m 1 1 ans = 1 ans 1 mode = False mode False left = -1 left -1 right = -1 right -1 for i in range(N+1):
  if stairs[i] == 0:
    if not mode:
      left = i
      mode = True
  else:
    if mode:
      right = i
      n = right - left
      ans *= nums[n]
      mode = False
       i range(N+1) range N+1 N 1 if stairs[i] == 0:
    if not mode:
      left = i
      mode = True
  else:
    if mode:
      right = i
      n = right - left
      ans *= nums[n]
      mode = False
       stairs[i] == 0 stairs[i] stairs i 0 if not mode:
      left = i
      mode = True
   not mode mode left = i left i mode = True mode True if mode:
      right = i
      n = right - left
      ans *= nums[n]
      mode = False
       mode right = i right i n = right - left n right - left right left ans *= nums[n] ans nums[n] nums n mode = False mode False if flag:
  print(ans%(10**9+7))
else:
  print(0) flag print(ans%(10**9+7)) print ans%(10**9+7) ans 10**9+7 10**9 10 9 7 print(0) print 0 left = i i left ans *= nums[n] nums[n] ans left = -1 -1 left mode = False False mode flag = True True flag stairs = [0]*N [0]*N stairs plus = nums[i-2] + nums[i-1] nums[i-2] + nums[i-1] plus n = right - left right - left n right = i i right nums = [1, 2] [1, 2] nums flag = False False flag mode = True True mode m = int(input()) int(input()) m ans = 1 1 ans mode = False False mode M = map(int, input().split()) map(int, input().split()) M N, M = map(int, input().split()) map(int, input().split()) N right = -1 -1 right
N, M = map(int, input().split())

nums = [1, 2]
for i in range(2, N+1):
  plus = nums[i-2] + nums[i-1]
  nums.append(plus)
  
stairs = [0]*N
stairs[0] = 1
stairs.append(1)
flag = True
for i in range(M):
  m = int(input())
  if stairs[m] == 1:
    flag = False
    break
  else:
    stairs[m-1], stairs[m], stairs[m+1] = 1, 1, 1
  
ans = 1
mode = False
left = -1
right = -1
for i in range(N+1):
  if stairs[i] == 0:
    if not mode:
      left = i
      mode = True
  else:
    if mode:
      right = i
      n = right - left
      ans *= nums[n]
      mode = False
      
if flag:
  print(ans%(10**9+7))
else:
  print(0)