gets $<.map{p gets.split.map{_1.to_i+1}.reduce(:*)%(10**9+7)-1}