Moving Dots

아직 제출이 없습니다시간 제한1.5초메모리 제한1024 MB

문제

We play a game with nn dots on a number line.

The initial coordinate of the ii-th dot is x_ix\_i. These coordinates are distinct. Every dot starts moving simultaneously with the same constant speed.

Each dot moves in the direction of the closest dot (different from itself) until it meets another dot. In the case of a tie, it goes to the left. Two dots meet if they are in the same coordinate, after that, they stop moving.

After enough time, every dot stops moving. The result of a game is the number of distinct coordinates where the dots stop.

Because this game is too easy, calculate the sum of results when we play the game for every subset of the given nn dots that has at least two dots. As the result can be very large, print the sum modulo 109+710^9+7.

입력

The first line contains one integer nn (2n30002 \leq n \leq 3000).

The next line contains nn integers x_1,x_2,,x_nx\_1, x\_2, \ldots, x\_n (1x_1<x_2<<x_n1091 \leq x\_1 < x\_2 < \ldots < x\_n \leq 10^9), where x_ix\_i represents the initial coordinate of ii-th dot.

출력

Print the sum of results modulo 109+710^9+7.