# Enter your code here. Read input from STDIN. Print output to STDOUT array = gets.chomp.split(' ') a = array[0].to_i b = array[1].to_i t = array[2].to_i puts ((a + b)/2) % ((10 ** 9) + 7)