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 s(int a, int b) {
  int res = a + b;
  if (res < 0) res += mod;
  if (res >= mod) res -= mod;
  return res;
}
inline int mult(int a, int b) { return ((long long)a * b) % mod; }
inline int bp(int a, int n) {
  int res = 1;
  for (; n; n >>= 1, a = mult(a, a)) {
    if (n & 1) res = mult(res, a);
  }
  return res;
}
inline int inv(int a) { return bp(a, mod - 2); }
const int inv2 = (mod + 1) / 2;
const int Root5 = 383008016;
const int invRoot5 = bp(Root5, mod - 2);
const int Phi = mult(s(1, Root5), inv2);
const int invPhi = mult(s(1, -Root5), inv2);
const int N = 3e5 + 5;
int ar[N], t[2][4 * N], add[2][4 * N];
int pw[2][N];
int iv[2];
inline int geom(int fr, int i, int n) {
  int a = s(pw[i][n], -1);
  int b = iv[i];
  return mult(mult(fr, a), b);
}
void build(int v, int vl, int vr) {
  if (vl == vr) {
    t[0][v] = t[1][v] = 0;
    return;
  }
  int m = vl + vr >> 1;
  build(2 * v + 1, vl, m);
  build(2 * v + 2, m + 1, vr);
}
void push(int v, int vl, int vr) {
  for (int i = 0; i < 2; ++i) {
    if (add[i][v] == 0) continue;
    int m = vl + vr >> 1;
    int ns = geom(add[i][v], i, vr - vl + 1);
    if (vl != vr) {
      add[i][2 * v + 1] = s(add[i][2 * v + 1], add[i][v]);
      add[i][2 * v + 2] =
          s(add[i][2 * v + 2], mult(add[i][v], pw[i][m - vl + 1]));
    }
    t[i][v] = s(t[i][v], ns);
    add[i][v] = 0;
  }
}
int get(int v, int vl, int vr, int l, int r, int i) {
  push(v, vl, vr);
  if (l > r)
    return 0;
  else if (vl == l && vr == r)
    return t[i][v];
  int m = vl + vr >> 1;
  int a = get(2 * v + 1, vl, m, l, min(r, m), i);
  int b = get(2 * v + 2, m + 1, vr, max(l, m + 1), r, i);
  return s(a, b);
}
void upd(int v, int vl, int vr, int l, int r, int i, int L) {
  push(v, vl, vr);
  if (l > r)
    return;
  else if (vl == l && vr == r) {
    add[i][v] = s(add[i][v], pw[i][vl - L + 1]);
    push(v, vl, vr);
    return;
  }
  int m = vl + vr >> 1;
  upd(2 * v + 1, vl, m, l, min(r, m), i, L);
  upd(2 * v + 2, m + 1, vr, max(l, m + 1), r, i, L);
  t[i][v] = s(t[i][2 * v + 1], t[i][2 * v + 2]);
}
void solve() {
  pw[0][0] = pw[1][0] = 1;
  for (int i = 1; i < N; ++i) {
    pw[0][i] = mult(pw[0][i - 1], Phi);
    pw[1][i] = mult(pw[1][i - 1], invPhi);
  }
  iv[0] = bp(pw[0][1] - 1, mod - 2);
  iv[1] = bp(pw[1][1] - 1, mod - 2);
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; ++i) cin >> ar[i];
  vector<int> pf(n);
  pf[0] = ar[0];
  for (int i = 1; i < n; ++i) pf[i] = s(pf[i - 1], ar[i]);
  build(0, 0, n - 1);
  while (q--) {
    int t, l, r;
    cin >> t >> l >> r;
    --l;
    --r;
    if (t == 1) {
      upd(0, 0, n - 1, l, r, 0, l);
      upd(0, 0, n - 1, l, r, 1, l);
    } else {
      int sum = s(pf[r], !l ? 0 : -pf[l - 1]);
      int firsum = get(0, 0, n - 1, l, r, 0);
      int secsum = -get(0, 0, n - 1, l, r, 1);
      int res = s(firsum, secsum);
      res = mult(res, invRoot5);
      res = s(res, sum);
      cout << res << '\n';
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int q = 1;
  while (q--) solve();
}
