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;
inline int read() {
  int res = 0;
  int neg;
  while (true) {
    char ch = getchar();
    if (ch >= '0' && ch <= '9' || ch == '-') {
      if (ch == '-')
        neg = -1;
      else
        neg = 1, res = ch - '0';
      break;
    }
  }
  while (true) {
    char ch = getchar();
    if (ch >= '0' && ch <= '9')
      res *= 10, res += ch - '0';
    else
      break;
  }
  return res * neg;
}
const int maxn = 350020;
const int maxm = 1020;
const int MOd = 1e9 + 9;
struct node {
  long long m[2][2];
};
int a, n, ar[maxn], q, sz[maxn * 3];
long long segment[maxn * 3], fib[maxn * 2][2][2], h[2][2], sum[maxn * 2][2][2];
node lazy[maxn * 3];
void add(long long &x, long long y) {
  x += y % MOd;
  if (x >= MOd) x -= MOd;
  if (x < 0) x += MOd;
}
void ind(int k) {
  if (lazy[k].m[0][0]) {
    memset(h, 0, sizeof(h));
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        for (int l = 0; l < 2; l++)
          add(h[i][j], sum[sz[k] - 1][i][l] * lazy[k].m[l][j]);
    add(segment[k], h[0][0]);
    if (k < n) {
      memset(h, 0, sizeof(h));
      for (int i = 0; i < 2; i++)
        for (int j = 0; j < 2; j++)
          for (int l = 0; l < 2; l++)
            add(h[i][j], fib[sz[2 * k]][i][l] * lazy[k].m[l][j]);
      for (int i = 0; i < 2; i++)
        for (int j = 0; j < 2; j++) add(lazy[2 * k + 1].m[i][j], h[i][j]);
      for (int i = 0; i < 2; i++)
        for (int j = 0; j < 2; j++) add(lazy[2 * k].m[i][j], lazy[k].m[i][j]);
    }
    memset(lazy[k].m, 0, sizeof(lazy[k].m));
  }
}
long long update(int k, int b, int s, int x, int y) {
  ind(k);
  if (b > y || x > s) return segment[k];
  if (x <= b && s <= y) {
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++) lazy[k].m[i][j] = fib[b - x][i][j];
    ind(k);
    return segment[k];
  }
  return segment[k] =
             (update(2 * k, b, (((b + s) < 0) ? (b + s) / 2 - 1 : (b + s) / 2),
                     x, y) +
              update(2 * k + 1,
                     (((b + s) < 0) ? (b + s) / 2 - 1 : (b + s) / 2) + 1, s, x,
                     y)) %
             MOd;
}
long long find(int k, int b, int s, int x, int y) {
  ind(k);
  if (b > y || x > s) return 0;
  if (x <= b && s <= y) return segment[k];
  return (find(2 * k, b, (((b + s) < 0) ? (b + s) / 2 - 1 : (b + s) / 2), x,
               y) +
          find(2 * k + 1, (((b + s) < 0) ? (b + s) / 2 - 1 : (b + s) / 2) + 1,
               s, x, y)) %
         MOd;
}
int main() {
  scanf("%d %d", &a, &q);
  n = 1;
  while (n < a) n <<= 1;
  for (int i = 1; i <= a; i++) scanf("%d", &ar[i]), segment[i + n - 1] = ar[i];
  for (int i = n - 1; i >= 1; i--)
    segment[i] = segment[i + i] + segment[i + i + 1];
  fib[0][0][0] = fib[0][1][1] = 1;
  sum[0][0][0] = sum[0][1][1] = 1;
  fib[1][0][0] = fib[1][1][0] = fib[1][0][1] = 1;
  for (int k = 2; k <= n; k++)
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        for (int l = 0; l < 2; l++)
          add(fib[k][i][j], fib[k - 1][i][l] * fib[1][l][j]);
  for (int k = 1; k <= n; k++)
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        add(sum[k][i][j], sum[k - 1][i][j] + fib[k][i][j]);
  for (int i = n; i < 2 * n; i++) sz[i] = 1;
  for (int i = n - 1; i >= 1; i--) sz[i] = sz[i + i] + sz[i + i + 1];
  while (q--) {
    int tp, x, y;
    scanf("%d %d %d", &tp, &x, &y);
    if (tp == 1) {
      update(1, 1, n, x, y);
    } else {
      long long t = find(1, 1, n, x, y);
      printf("%I64d\n", t);
    }
  }
  return 0;
}
