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;
#pragma comment(linker, "/STACK:256000000")
template <class T>
T sqr(T a) {
  return a * a;
}
long long n, m, a[300001], b[1200000], mo = 1e9 + 9;
pair<long long, long long> d[1200000];
struct mat {
  long long a[2][2];
  void operator*=(mat b) {
    long long t[2][2];
    memset(t, 0, sizeof(t));
    for (int i = 0; i < 2; ++i)
      for (int j = 0; j < 2; ++j)
        for (int r = 0; r < 2; ++r)
          t[i][j] += (((long long)a[i][r]) * b.a[r][j]) % mo;
    for (int i = 0; i < 2; ++i)
      for (int j = 0; j < 2; ++j) a[i][j] = t[i][j];
  }
  void operator=(mat b) {
    for (int i = 0; i < 2; ++i)
      for (int j = 0; j < 2; ++j) a[i][j] = b.a[i][j];
  }
  void operator+=(mat b) {
    for (int i = 0; i < 2; ++i)
      for (int j = 0; j < 2; ++j) a[i][j] = (a[i][j] + b.a[i][j]) % mo;
  }
};
mat A[300001], s[300001], ar;
void build(int u, int l, int r) {
  if (l == r) {
    b[u] = a[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(2 * u, l, mid);
  build(2 * u + 1, mid + 1, r);
  b[u] = b[2 * u] + b[2 * u + 1];
}
long long add(int u, int tl, int tr, int l, int r, int num1, int num2) {
  if (l > r) return 0;
  if (tl == l && tr == r) {
    long long t1 = (s[r - l].a[1][0] * (long long)d[u].second) % mo +
                   (s[r - l].a[1][1] * d[u].first) % mo;
    d[u].first += (A[num1 - 1].a[1][0] + A[num1 - 1].a[1][1]) % mo;
    d[u].second += (A[num1 - 1].a[0][0] + A[num1 - 1].a[0][1]) % mo;
    d[u].first %= mo;
    d[u].second %= mo;
    long long t = (s[r - l].a[1][0] * (long long)d[u].second) % mo +
                  (s[r - l].a[1][1] * d[u].first) % mo;
    t %= mo;
    b[u] = (b[u] + (t - t1 + mo) % mo) % mo;
    return (t - t1 + mo) % mo;
  }
  int mid = (tl + tr) >> 1;
  long long t =
      add(2 * u, tl, mid, l, min(r, mid), num1, min(num2, mid - l + 1));
  long long t1 = add(2 * u + 1, mid + 1, tr, max(l, mid + 1), r,
                     num1 + max(0, mid - l + 1), num2);
  b[u] = ((t + t1) % mo + b[u]) % mo;
  return (t + t1) % mo;
}
long long sum(int u, int tl, int tr, int l, int r) {
  if (l > r) return 0;
  if (tl == l && tr == r) return b[u];
  int mid = (tl + tr) >> 1;
  long long t = sum(2 * u, tl, mid, l, min(r, mid));
  long long t1 = sum(2 * u + 1, mid + 1, tr, max(l, mid + 1), r);
  long long s2 = 0, s1 = 0;
  if (l > tl)
    s1 = (s[l - tl - 1].a[1][0] * (long long)d[u].second) % mo +
         (s[l - tl - 1].a[1][1] * (long long)d[u].first) % mo;
  s1 %= mo;
  s2 = ((s[r - tl].a[1][0] * (long long)d[u].second) % mo +
        (s[r - tl].a[1][1] * (long long)d[u].first) % mo) %
       mo;
  long long t2 = (t1 + t) % mo;
  return (t2 + (s2 - s1 + mo) % mo) % mo;
}
void init() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  build(1, 0, n - 1);
  A[0].a[0][0] = 1;
  A[0].a[0][1] = 0;
  A[0].a[1][0] = 0;
  A[0].a[1][1] = 1;
  ar.a[0][0] = 1;
  ar.a[0][1] = 1;
  ar.a[1][0] = 1;
  ar.a[1][1] = 0;
  s[0] = A[0];
  for (int i = 1; i <= n; ++i) {
    A[i] = A[i - 1];
    A[i] *= ar;
    s[i] = s[i - 1];
    s[i] += A[i];
  }
}
void solve() {
  for (int i = 0; i < m; ++i) {
    int q, l, r;
    scanf("%d%d%d", &q, &l, &r);
    q--, l--, r--;
    if (q) {
      long long xur = sum(1, 0, n - 1, l, r);
      xur = (xur + mo) % mo;
      printf("%lld\n", xur);
    } else
      add(1, 0, n - 1, l, r, 1, r - l + 1);
  }
}
int main() {
  init();
  solve();
  return 0;
}
