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;
template <class T>
inline void maz(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
inline void miz(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
void RI() {}
template <typename... T>
void RI(int &head, T &...tail) {
  scanf("%d", &head);
  RI(tail...);
}
const int N = 300100, MOD = 1000000009;
inline int add(int x, int y) {
  if (x + y >= MOD) return x + y - MOD;
  return x + y;
}
inline int mul(int x, int y) { return (long long)x * y % MOD; }
struct unit2 {
  int p[2][2];
  unit2(int a) {
    p[0][0] = p[1][1] = 1;
    p[0][1] = p[1][0] = 0;
  }
  unit2() { memset(p, 0, sizeof(p)); }
  unit2 operator*(const unit2 &A) const {
    unit2 tmp;
    int n = 2;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++)
        for (int k = 0; k < n; k++)
          tmp.p[i][j] = add(tmp.p[i][j], mul(p[i][k], A.p[k][j]));
    return tmp;
  }
} V[N];
struct unit3 {
  int p[3][3];
  unit3(int a) {
    memset(p, 0, sizeof(p));
    p[0][0] = p[1][1] = p[2][2] = 1;
  }
  unit3() { memset(p, 0, sizeof(p)); }
  unit3 operator*(const unit3 &A) const {
    unit3 tmp;
    int n = 3;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++)
        for (int k = 0; k < n; k++)
          tmp.p[i][j] = add(tmp.p[i][j], mul(p[i][k], A.p[k][j]));
    return tmp;
  }
  void print() const {
    int n = 3;
    for (int i = 0; i < n; i++, puts(""))
      for (int j = 0; j < n; j++) printf("%d ", p[i][j]);
  }
} S[N];
std::pair<int, int> getV(int A, int B, int n) {
  if (n <= 0) return std::make_pair(A, B);
  unit2 a = V[n];
  int x = add(mul(a.p[0][0], A), mul(B, a.p[0][1]));
  int y = add(mul(a.p[1][0], A), mul(B, a.p[1][1]));
  return std::make_pair(x, y);
}
int getS(int A, int B, int n) {
  if (n == 1) return A;
  if (n == 2) return add(A, B);
  unit3 a = S[n - 2];
  int ans = add(mul(a.p[2][0], A), mul(a.p[2][1], B));
  ans = add(ans, mul(a.p[2][2], add(A, B)));
  return ans;
}
struct Node {
  int cov[2];
  int sum;
  Node(int v) {
    sum = v;
    cov[0] = cov[1] = 0;
  }
  Node() { sum = 0; }
  void cover(int a, int b) {
    cov[0] = add(cov[0], a);
    cov[1] = add(cov[1], b);
  }
  void sign_down(Node &l, Node &r, int L, int R) {
    if (cov[0] == 0) return;
    l.cover(cov[0], cov[1]);
    int mid = L + R >> 1;
    std::pair<int, int> ret = getV(cov[0], cov[1], mid + 1 - L);
    r.cover(ret.first, ret.second);
    sum = add(sum, getS(cov[0], cov[1], R - L + 1));
    cov[0] = cov[1] = 0;
  }
  int qry(int L, int R) {
    if (cov[0] == 0) return sum;
    return add(sum, getS(cov[0], cov[1], R - L + 1));
  }
} ST[N * 4];
int val[N];
void maketree(int p, int L, int R) {
  if (L == R) {
    ST[p] = Node(val[L]);
    return;
  }
  int mid = L + R >> 1, p1 = p << 1;
  maketree(p1, L, mid);
  maketree(p1 + 1, mid + 1, R);
  ST[p].sum = add(ST[p1].sum, ST[p1 + 1].sum);
}
void cov(int p, int L, int R, int x, int y, int a, int b) {
  if (L > y || R < x) return;
  if (L >= x && R <= y) {
    std::pair<int, int> ret = getV(a, b, L - x);
    ST[p].cover(ret.first, ret.second);
    return;
  }
  int mid = L + R >> 1, p1 = p << 1;
  ST[p].sign_down(ST[p1], ST[p1 + 1], L, R);
  cov(p1, L, mid, x, y, a, b);
  cov(p1 + 1, mid + 1, R, x, y, a, b);
  ST[p].sum = add(ST[p1].qry(L, mid), ST[p1 + 1].qry(mid + 1, R));
}
int qry(int p, int L, int R, int x, int y) {
  if (L > y || R < x) return 0;
  if (L >= x && R <= y) {
    return ST[p].qry(L, R);
  }
  int mid = L + R >> 1, p1 = p << 1;
  ST[p].sign_down(ST[p1], ST[p1 + 1], L, R);
  return add(qry(p1, L, mid, x, y), qry(p1 + 1, mid + 1, R, x, y));
}
int n, q;
void make2() {
  unit2 q;
  q.p[0][0] = 0;
  q.p[0][1] = q.p[1][0] = q.p[1][1] = 1;
  V[0] = unit2(1);
  for (int i = 1; i <= n; i++) V[i] = V[i - 1] * q;
}
void make3() {
  unit3 q;
  q.p[0][1] = q.p[1][0] = q.p[1][1] = 1;
  q.p[2][0] = q.p[2][1] = q.p[2][2] = 1;
  S[0] = unit3(1);
  for (int i = 1; i <= n; i++) S[i] = S[i - 1] * q;
}
int main() {
  RI(n, q);
  make2();
  make3();
  for (int i = 1; i <= n; i++) RI(val[i]);
  maketree(1, 1, n);
  while (q--) {
    int t, l, r;
    RI(t, l, r);
    if (t == 1) {
      cov(1, 1, n, l, r, 1, 1);
    } else {
      int ans = qry(1, 1, n, l, r);
      printf("%d\n", ans);
    }
  }
  return 0;
}
