import { readFileSync } from 'fs'

const range = (n: number) => Array(n).fill(null).map((_, i) => i)

function main(input: string) {
  const [[N, M], ...lines] = input.split('\n').map(v => v.split(' ').map(Number))

  const set = new Set(lines.map(([v]) => v))
  const memo = {} as Record<number, number>

  const fn = (n: number) => {
    if (n < 0) return 0
    if (n == 0) return 1
    if (memo[n]) return memo[n]

    const list = [n - 1, n - 2].filter(v => !set.has(v))
    const result = list.map(v => fn(v)).reduce((a, b) => a + b, 0)

    return memo[n] = result % 1000000007
  }

  // メモ化を利用して、再帰上限を回避
  range(N).forEach(v => fn(v))

  console.log(fn(N))
}

main(readFileSync('/dev/stdin', 'utf8').trim())
