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;
long long tree[1200001], laz1[1200001], laz2[1200001], f[300011], g[300011],
    F[300011];
long long a1[300011], x, y, i, n, m, ans, opt;
void build(long long o, long long l, long long r) {
  if (l == r) {
    tree[o] = a1[l] % 1000000009;
    return;
  }
  long long mid = (l + r) >> 1;
  build(o << 1, l, mid);
  build(o << 1 | 1, mid + 1, r);
  tree[o] = (tree[o << 1] + tree[o << 1 | 1]) % 1000000009;
}
void pushdown(long long o, long long ll) {
  if (laz1[o] || laz2[o]) {
    laz1[o << 1] = (laz1[o << 1] + laz1[o]) % 1000000009;
    laz2[o << 1] = (laz2[o << 1] + laz2[o]) % 1000000009;
    tree[o << 1] = (tree[o << 1] + F[ll - (ll >> 1) - 1] * laz1[o] +
                    g[ll - (ll >> 1) - 1] * laz2[o]) %
                   1000000009;
    int vaa = (f[ll - (ll >> 1)] * laz2[o] + f[ll - (ll >> 1) - 1] * laz1[o]) %
              1000000009;
    int vbb = (f[ll - (ll >> 1) + 1] * laz2[o] + f[ll - (ll >> 1)] * laz1[o]) %
              1000000009;
    tree[o << 1 | 1] =
        (tree[o << 1 | 1] + F[(ll >> 1) - 1] * vaa + g[(ll >> 1) - 1] * vbb) %
        1000000009;
    laz1[o << 1 | 1] = (laz1[o << 1 | 1] + vaa) % 1000000009;
    laz2[o << 1 | 1] = (laz2[o << 1 | 1] + vbb) % 1000000009;
    laz1[o] = laz2[o] = 0;
  }
}
void update(long long o, long long l, long long r, long long L, long long R,
            long long va, long long vb) {
  if (L <= l && r <= R) {
    laz1[o] = (laz1[o] + va) % 1000000009;
    laz2[o] = (laz2[o] + vb) % 1000000009;
    tree[o] = (tree[o] + g[r - l] * vb + F[r - l] * va) % 1000000009;
    return;
  }
  long long mid = (l + r) >> 1;
  pushdown(o, r - l + 1);
  if (L <= mid) update(o << 1, l, mid, L, R, va, vb);
  if (mid < R) {
    long long vaa = va;
    long long vbb = vb;
    if (L <= mid) {
      int len = mid - max(L, l) + 1;
      vaa = (f[len] * vb + f[len - 1] * va) % 1000000009;
      vbb = (f[len + 1] * vb + f[len] * va) % 1000000009;
    }
    update(o << 1 | 1, mid + 1, r, L, R, vaa, vbb);
  }
  tree[o] = (tree[o << 1] + tree[o << 1 | 1]) % 1000000009;
}
void query(long long o, long long l, long long r, long long L, long long R) {
  if (L <= l && r <= R) {
    ans = (ans + tree[o]) % 1000000009;
    return;
  }
  long long mid = (l + r) >> 1;
  pushdown(o, r - l + 1);
  if (L <= mid) query(o << 1, l, mid, L, R);
  if (mid < R) query(o << 1 | 1, mid + 1, r, L, R);
}
int main() {
  scanf("%I64d%I64d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%I64d", &a1[i]);
  f[1] = 1;
  g[1] = 1;
  F[0] = F[1] = 1;
  for (i = 2; i <= 300000; i++) {
    f[i] = (f[i - 1] + f[i - 2]) % 1000000009;
    g[i] = (g[i - 1] + f[i]) % 1000000009;
    F[i] = (F[i - 1] + f[i - 1]) % 1000000009;
  }
  build(1, 1, n);
  for (i = 1; i <= m; i++) {
    scanf("%I64d%I64d%I64d", &opt, &x, &y);
    switch (opt) {
      case 1:
        update(1, 1, n, x, y, 1, 1);
        break;
      case 2:
        ans = 0;
        query(1, 1, n, x, y);
        printf("%I64d\n", ans);
        break;
    }
  }
}
