defmodule Main do def input, do: IO.read(:line) |> String.trim def ii, do: input() |> String.to_integer def li, do: input() |> String.split |> Enum.map(&String.to_integer/1) def yn(b), do: IO.puts(if b, do: "Yes", else: "No") @mod 10**9 + 7 def f([x]), do: x def f(xs) do Enum.chunk_every(xs, 2, 1, :discard) |> Enum.map(fn [a, b] -> rem(a+b, @mod) end) |> f() end def main do n = ii() a = li() ans = f(a) IO.puts ans end end