How many increasing - 2#5976

How many increasing - 2

1 second
64 megabytes
Easy

Given a sequence of integers, your task is to determine the number of strictly increasing subsequences within this sequence.

Input

The first line of the input contains the integer , which is followed by integers on the next line. These integers, separated by one or more spaces, form the sequence (1 \le N \le 100000, and each integer's absolute value does not exceed 1{,}25 \cdot 10^5).

Output

Output a single line containing the number of strictly increasing subsequences, with the result given modulo (10^9+9).

Examples

Example 1

Loading
Loading