In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation 

F1 = 1; F2 = 1; Fn = Fn - 1 + Fn - 2 (n > 2).

DZY loves Fibonacci numbers very much. Today DZY gives you an array consisting of n integers: a1, a2, ..., an. Moreover, there are m queries, each query has one of the two types:

  1. Format of the query "1 l r". In reply to the query, you need to add Fi - l + 1 to each element ai, where l ≤ i ≤ r. 
  2. Format of the query "2 l r". In reply to the query you should output the value of <image> modulo 1000000009 (109 + 9). 



Help DZY reply to all the queries.

Input

The first line of the input contains two integers n and m (1 ≤ n, m ≤ 300000). The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109) — initial array a.

Then, m lines follow. A single line describes a single query in the format given in the statement. It is guaranteed that for each query inequality 1 ≤ l ≤ r ≤ n holds.

Output

For each query of the second type, print the value of the sum on a single line.

Examples

Input

4 4
1 2 3 4
1 1 4
2 1 4
1 2 4
2 1 3


Output

17
12

Note

After the first query, a = [2, 3, 5, 7].

For the second query, sum = 2 + 3 + 5 + 7 = 17.

After the third query, a = [2, 4, 6, 9].

For the fourth query, sum = 2 + 4 + 6 = 12.
#include <bits/stdc++.h>
using namespace std;
const int N = 300030;
const int mod = 1e9 + 9;
int n, m, a[N], s[N], f[N][3], fs[N][3], fib[N];
int x1[N << 2], x2[N << 2], sum[N << 2];
void update(int d) { sum[d] = (sum[d << 1] + sum[d << 1 | 1]) % mod; }
void mark(int d, int lt, int rt, int y1, int y2) {
  if (lt == rt) {
    (sum[d] += y1) %= mod;
    (x1[d] += y1) %= mod;
  } else {
    int len = rt - lt + 1;
    sum[d] += ((long long)y1 * fs[len][1] + (long long)y2 * fs[len][2]) % mod;
    sum[d] %= mod;
    (x1[d] += y1) %= mod;
    (x2[d] += y2) %= mod;
  }
}
void push(int d, int lt, int rt) {
  if (x1[d] || x2[d]) {
    int md = (lt + rt) >> 1, son = d << 1;
    mark(son, lt, md, x1[d], x2[d]);
    int t = 1 + (md - lt + 1);
    int y1 = ((long long)x1[d] * f[t][1] + (long long)x2[d] * f[t][2]) % mod;
    int y2 =
        ((long long)x1[d] * f[t + 1][1] + (long long)x2[d] * f[t + 1][2]) % mod;
    mark(son + 1, md + 1, rt, y1, y2);
    x1[d] = x2[d] = 0;
  }
}
void modify(int d, int lt, int rt, int lq, int rq, int st) {
  if (lq <= lt && rt <= rq) {
    mark(d, lt, rt, fib[lt - lq + 1], fib[lt - lq + 2]);
  } else {
    push(d, lt, rt);
    int md = (lt + rt) >> 1, son = d << 1;
    if (lq <= md) modify(son, lt, md, lq, rq, st);
    if (md < rq) modify(son + 1, md + 1, rt, lq, rq, st);
    update(d);
  }
}
int asksum(int d, int lt, int rt, int lq, int rq) {
  if (lq <= lt && rt <= rq) {
    return sum[d];
  } else {
    push(d, lt, rt);
    int md = (lt + rt) >> 1, son = d << 1;
    int ret = 0;
    if (lq <= md) ret += asksum(son, lt, md, lq, rq);
    if (md < rq) ret += asksum(son + 1, md + 1, rt, lq, rq);
    return ret % mod;
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    s[i] = (s[i - 1] + a[i]) % mod;
  }
  fib[1] = fib[2] = 1;
  for (int i = 3; i <= n + 1; ++i) {
    fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
  }
  f[1][1] = 1;
  f[2][2] = 1;
  for (int i = 3; i <= n + 1; ++i) {
    f[i][1] = (f[i - 1][1] + f[i - 2][1]) % mod;
    f[i][2] = (f[i - 1][2] + f[i - 2][2]) % mod;
  }
  for (int i = 1; i <= n + 1; ++i) {
    fs[i][1] = (fs[i - 1][1] + f[i][1]) % mod;
    fs[i][2] = (fs[i - 1][2] + f[i][2]) % mod;
  }
  while (m--) {
    int cmd, l, r;
    scanf("%d %d %d", &cmd, &l, &r);
    if (cmd == 1) {
      modify(1, 1, n, l, r, 1);
    } else {
      int ans = (s[r] - s[l - 1] + mod) % mod;
      (ans += asksum(1, 1, n, l, r)) %= mod;
      printf("%d\n", ans);
    }
  }
}
