zahyo = gets.chomp.split(" ").map(&:to_i)
gx = zahyo[0]
gy = zahyo[1]

def fact(n)
  (1..n).inject(&:*)
end

kaisu = 0

(0..gx).each{|ma|
  mb = (gx-ma)/2
  if (gx-ma) % 2 ==0  and  gy == 2*ma + mb #xの偶奇がだめなら論外
      kaisu +=  ((fact(ma+mb)/fact(ma)*fact(mb))) 
      kaitu = kaisu % (10**9+7)
  end
 }

puts kaisu % (10**9+7)