log = console.log;

var stdin = require("fs").readFileSync("/dev/stdin", "UTF-8");
var lines = stdin.split("\n");
var N = lines[0].split(" ").map(Number)[0];
var M = lines[0].split(" ").map(Number)[1];
var as = lines
  .slice(1)
  .filter(v => v !== "")
  .map(Number);

steps = Array(N + 1).fill(true);
var dead = false;
as.forEach((v, i) => {
  steps[v] = false;
  if (steps[v - 1] === false) dead = true;
});

if (dead) {
  log(0);
} else {
  moveCounts = [];
  steps.forEach((bool, i) => {
    if (!bool) {
      moveCounts[i] = 0;
    } else if (i === 0) {
      moveCounts[i] = 0;
    } else if (i === 1 && bool) {
      moveCounts[i] = 1;
    } else if (i === 1 && !bool) {
      moveCounts[i] = 0;
    } else if (i === 2 && bool) {
      moveCounts[i] = moveCounts[i - 1] + 1;
    } else {
      moveCounts[i] = moveCounts[i - 1] + moveCounts[i - 2];
    }
  });
  count = moveCounts[N] % 1000000007;
  log(count);
}
