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 = 300005;
const int mod = 1000000009;
long long int BIT1[N], BIT2[N];
long long int sm[N];
long long int F[N];
long long int A[N];
struct node {
  long long int a1, a2;
};
node ST[5 * N];
void pre() {
  F[1] = F[2] = 1;
  sm[1] = 1;
  sm[2] = 2;
  for (int i = 3; i < N; i++) {
    F[i] = (F[i - 1] + F[i - 2]) % mod;
    sm[i] = (sm[i - 1] + F[i]) % mod;
  }
}
void updateBit(long long int *bit, int idx, long long int val) {
  for (int i = idx; i < N; i += i & -i) {
    bit[i] += val;
    if (bit[i] >= mod) bit[i] -= mod;
  }
}
long long int queryBit(long long int *bit, int idx) {
  long long int res = 0;
  for (int i = idx; i; i -= i & -i) res += bit[i];
  return res % mod;
}
long long int X[2][2] = {{1, 1}, {1, 0}};
long long int Y[2][2];
long long int Z[2];
void solve(int n) {
  if (n == 1) return;
  solve(n / 2);
  long long int C[2][2];
  memset(C, 0, sizeof(C));
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++) {
      for (int k = 0; k < 2; k++) {
        C[i][j] += Y[i][k] * Y[k][j];
        C[i][j] %= mod;
      }
    }
  memcpy(Y, C, sizeof(Y));
  if (n & 1) {
    memset(C, 0, sizeof(C));
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++) {
        for (int k = 0; k < 2; k++) {
          C[i][j] += Y[i][k] * X[k][j];
          C[i][j] %= mod;
        }
      }
    memcpy(Y, C, sizeof(Y));
  }
}
void _find(int f, int s, int n) {
  memcpy(Y, X, sizeof(X));
  if (n == 1) {
    Z[0] = f;
    Z[1] = 0;
    Y[1][0] = 0;
    return;
  }
  if (n == 2) {
    Z[0] = s;
    Z[1] = f;
    Y[0][1] = 0;
    Y[1][0] = 0;
    Y[1][1] = 1;
    return;
  }
  Z[0] = s;
  Z[1] = f;
  solve(n - 2);
}
void update(int n, int b, int e, int x, int y, int f, int s) {
  if (b == x && e == y) {
    ST[n].a1 += f;
    ST[n].a1 %= mod;
    ST[n].a2 += s;
    ST[n].a2 %= mod;
    return;
  }
  int m = (b + e) >> 1;
  int trm = m + 3 - x;
  if (y <= m) {
    update(n << 1, b, m, x, y, f, s);
  } else {
    long long int t1, t2;
    if (trm == 1) {
      t2 = f;
      t1 = 0;
    } else if (trm == 2) {
      t2 = s;
      t1 = f;
    } else if (trm > 2) {
      t2 = (f * F[trm - 2] + s * F[trm - 1]) % mod;
      t1 = (f * F[trm - 3] + s * F[trm - 2]) % mod;
    }
    if (x > m) {
      update((n << 1) | 1, m + 1, e, x, y, f, s);
    } else {
      update(n << 1, b, m, x, m, f, s);
      update((n << 1) | 1, m + 1, e, m + 1, y, t1, t2);
    }
  }
}
long long int query(int n, int b, int e, int idx) {
  if (!idx) return 0;
  if (b == e) {
    return ST[n].a1;
  }
  long long int res = 0;
  if (ST[n].a1 || ST[n].a2) {
    _find(ST[n].a1, ST[n].a2, idx - b + 1);
    int trm = idx - b + 1;
    if (trm == 1)
      res = ST[n].a1;
    else if (trm == 2)
      res = ST[n].a2;
    else if (trm > 2)
      res = (ST[n].a1 * F[trm - 2] + ST[n].a2 * F[trm - 1]) % mod;
  }
  int m = (b + e) >> 1;
  if (idx <= m)
    return (res + query(n << 1, b, m, idx)) % mod;
  else
    return (res + query((n << 1) | 1, m + 1, e, idx)) % mod;
}
void UUU(int l, int r, int n) {
  updateBit(BIT1, l, 1);
  updateBit(BIT1, r + 1, -1);
  int f = sm[l] - 1;
  int s = sm[l + 1] - 2;
  if (f < 0) f += mod;
  if (s < 0) s += mod;
  update(1, 1, n, l, r, f, s);
  updateBit(BIT2, r + 1, sm[r - l + 1]);
}
long long int QQ(int idx, int n) {
  long long int res = queryBit(BIT1, idx) * sm[idx] % mod;
  res += queryBit(BIT2, idx);
  res -= query(1, 1, n, idx);
  res += A[idx];
  return ((res % mod) + mod) % mod;
}
long long int QQQ(int l, int r, int n) {
  return (QQ(r, n) - QQ(l - 1, n) + mod) % mod;
}
int main() {
  int n, m;
  pre();
  scanf("%d%d", &n, &m);
  for (int i = 1; i < n + 1; i++) cin >> A[i];
  for (int i = 2; i < n + 1; i++) A[i] += A[i - 1];
  while (m--) {
    int ty, l, r;
    scanf("%d%d%d", &ty, &l, &r);
    if (ty == 1) {
      UUU(l, r, n);
    } else {
      cout << QQQ(l, r, n) << endl;
    }
  }
  return 0;
}
