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 Mod = 1e9 + 9;
inline int FIX(long long a) { return (a % Mod + Mod) % Mod; }
const int N = 300000 + 5;
int n, m;
int ma[300000 + 5][4][4];
int a[N];
int tmp[3][3] = {{0, 1, 1}, {1, 1, 1}, {0, 0, 1}};
struct Seg {
  int l, r;
  long long v[3];
  long long sum;
} seg[4 * N + 5];
void build(int l, int r, int idx) {
  seg[idx].l = l;
  seg[idx].r = r;
  memset(seg[idx].v, 0, sizeof(seg[idx].v));
  seg[idx].sum = 0;
  if (l != r) {
    build(l, (l + r) / 2, 2 * idx);
    build((l + r) / 2 + 1, r, 2 * idx + 1);
  }
  return;
}
long long getsum(long long f1, long long f2, int n) {
  if (n == 1) {
    return f1;
  }
  long long v[3], ret = 0;
  v[0] = f1;
  v[1] = f2;
  v[2] = f1 + f2;
  for (int i = 0; i < 3; i++) {
    ret = ret + (long long)v[i] * ma[n - 2][i][2] % Mod;
    ret %= Mod;
  }
  return ret;
}
void mul(long long v[3], int n) {
  long long ret[3] = {0, 0, 0};
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      ret[i] = ret[i] + v[j] * ma[n][j][i] % Mod;
      ret[i] %= Mod;
    }
  }
  for (int i = 0; i < 3; i++) v[i] = ret[i];
}
void insert(int l, int r, int idx, long long f1, long long f2);
void push_down(int idx) {
  if (seg[idx].v[0] == 0 && seg[idx].v[1] == 0) return;
  insert(seg[idx].l, (seg[idx].l + seg[idx].r) / 2, 2 * idx, seg[idx].v[0],
         seg[idx].v[1]);
  int mid = (seg[idx].l + seg[idx].r) / 2;
  mul(seg[idx].v, mid - seg[idx].l + 1);
  insert(mid + 1, seg[idx].r, 2 * idx + 1, seg[idx].v[0], seg[idx].v[1]);
  seg[idx].v[0] = seg[idx].v[1] = seg[idx].v[2] = 0;
  return;
}
void merge(int idx) {
  seg[idx].sum = seg[2 * idx].sum + seg[2 * idx + 1].sum;
  seg[idx].sum %= Mod;
  return;
}
void insert(int l, int r, int idx, long long f1, long long f2) {
  if (seg[idx].l == l && seg[idx].r == r) {
    (seg[idx].v[0] += f1) %= Mod;
    (seg[idx].v[1] += f2) %= Mod;
    (seg[idx].v[2] += f1 + f2) %= Mod;
    seg[idx].sum += getsum(f1, f2, (r - l + 1));
    return;
  }
  push_down(idx);
  int mid = (seg[idx].l + seg[idx].r) / 2;
  if (r <= mid) {
    insert(l, r, 2 * idx, f1, f2);
  } else if (l > mid)
    insert(l, r, 2 * idx + 1, f1, f2);
  else {
    insert(l, mid, 2 * idx, f1, f2);
    long long v[3];
    v[0] = f1;
    v[1] = f2;
    v[2] = (f1 + f2) % Mod;
    mul(v, (mid - l + 1));
    insert(mid + 1, r, 2 * idx + 1, v[0], v[1]);
  }
  merge(idx);
  return;
}
long long query(int l, int r, int idx) {
  if (seg[idx].l == l && seg[idx].r == r) {
    return seg[idx].sum;
  }
  push_down(idx);
  int mid = (seg[idx].l + seg[idx].r) / 2;
  if (r <= mid) {
    return query(l, r, 2 * idx);
  } else if (l > mid)
    return query(l, r, 2 * idx + 1);
  else {
    return (query(l, mid, 2 * idx) + query(mid + 1, r, 2 * idx + 1)) % Mod;
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    a[i] += a[i - 1];
    a[i] %= Mod;
  }
  for (int i = 0; i < 3; i++) ma[0][i][i] = 1;
  for (int r = 1; r <= n; r++) {
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) {
        for (int k = 0; k < 3; k++) {
          ma[r][i][j] += ma[r - 1][i][k] * tmp[k][j];
          ma[r][i][j] %= Mod;
        }
      }
    }
  }
  build(1, n, 1);
  for (int i = 1; i <= m; i++) {
    int type, l, r;
    scanf("%d %d %d", &type, &l, &r);
    if (type == 1) {
      insert(l, r, 1, 1, 1);
    } else {
      long long ret = query(l, r, 1);
      ret = ret + a[r] - a[l - 1];
      ret = FIX(ret);
      cout << ret << endl;
    }
  }
  return 0;
}
