Peter sequence integer a1a2an Peter want number sequence equal h he perform operation add segment lr add element sequence indice l r inclusive at Peter choose element beginning segment twice Similarly Peter choose element end segment twice in word segment l1r1 l2r2 Peter add follow inequality hold l1l2 r1r2how distinct way number sequence equal h print number way modulo 10000000071097 two way consider distinct segment is not way