def lscan; gets.split.map(&:to_i); end n = gets.to_i a = lscan m = (1e9+7).to_i (n-1).times do a = a.each_cons(2).map{|x,y| x+y} end p a[0]%m