#include <bits/stdc++.h>
const double PI = acos(-1);
using namespace std;
int n, m;
struct node {
  long long x1, x2, val, ch;
  node() { x1 = x2 = val = ch = 0; }
};
node dp[300300 * 8];
long long pr1[300300];
long long pr2[300300];
long long fi1[300300];
long long fi2[300300];
void update(int p) {
  if (dp[p].ch == 0 || (dp[p].x1 == 0 && dp[p].x2 == 0)) return;
  dp[p].val += (dp[p].x1 * pr1[dp[p].ch]) % 1000000009;
  dp[p].val %= 1000000009;
  dp[p].val += (dp[p].x2 * pr2[dp[p].ch]) % 1000000009;
  dp[p].val %= 1000000009;
  dp[2 * p].x1 += dp[p].x1;
  dp[2 * p].x1 %= 1000000009;
  dp[2 * p].x2 += dp[p].x2;
  dp[2 * p].x2 %= 1000000009;
  dp[2 * p + 1].x1 += (dp[p].x1 * fi1[dp[2 * p].ch + 1]) % 1000000009;
  dp[2 * p + 1].x1 %= 1000000009;
  dp[2 * p + 1].x1 += (dp[p].x2 * fi2[dp[2 * p].ch + 1]) % 1000000009;
  dp[2 * p + 1].x1 %= 1000000009;
  dp[2 * p + 1].x2 += (dp[p].x1 * fi1[dp[2 * p].ch + 2]) % 1000000009;
  dp[2 * p + 1].x2 %= 1000000009;
  dp[2 * p + 1].x2 += (dp[p].x2 * fi2[dp[2 * p].ch + 2]) % 1000000009;
  dp[2 * p + 1].x2 %= 1000000009;
  dp[p].x1 = 0;
  dp[p].x2 = 0;
}
void add(int a, int b, long long x1, long long x2, int l = 1, int h = n,
         int p = 1) {
  if (l == h) {
    dp[p].ch = 1;
  }
  update(p);
  if (a == l && b == h) {
    dp[p].x1 = x1;
    dp[p].x2 = x2;
    update(p);
    return;
  }
  int m = (l + h) / 2;
  if (b <= m) {
    add(a, b, x1, x2, l, m, 2 * p);
  } else if (a > m) {
    add(a, b, x1, x2, m + 1, h, 2 * p + 1);
  } else {
    add(a, m, x1, x2, l, m, 2 * p);
    long long x3 = (x1 * fi1[m - a + 2]) % 1000000009;
    x3 += (x2 * fi2[m - a + 2]) % 1000000009;
    x3 %= 1000000009;
    long long x4 = (x1 * fi1[m - a + 3]) % 1000000009;
    x4 += (x2 * fi2[m - a + 3]) % 1000000009;
    x4 %= 1000000009;
    add(m + 1, b, x3, x4, m + 1, h, 2 * p + 1);
  }
  update(2 * p);
  update(2 * p + 1);
  dp[p].ch = dp[2 * p].ch + dp[2 * p + 1].ch;
  dp[p].val = dp[2 * p].val + dp[2 * p + 1].val;
  dp[p].val %= 1000000009;
}
long long cal(int a, int b, long long x1 = 0, long long x2 = 0, int l = 1,
              int h = n, int p = 1) {
  update(p);
  if (a == l && b == h) {
    return dp[p].val;
  }
  int m = (l + h) / 2;
  if (b <= m) {
    return cal(a, b, x1, x2, l, m, 2 * p);
  } else if (a > m) {
    return cal(a, b, x1, x2, m + 1, h, 2 * p + 1);
  } else {
    return (cal(a, m, x1, x2, l, m, 2 * p) +
            cal(m + 1, b, x1, x2, m + 1, h, 2 * p + 1)) %
           1000000009;
  }
}
long long a[300300];
int main() {
  fi1[1] = 1;
  fi2[1] = 0;
  fi1[2] = 0;
  fi2[2] = 1;
  for (int i = 3; i < 300300; i++) {
    fi1[i] = fi1[i - 2] + fi1[i - 1];
    fi1[i] %= 1000000009;
    fi2[i] = fi2[i - 2] + fi2[i - 1];
    fi2[i] %= 1000000009;
  }
  for (int i = 1; i < 300300; i++) {
    pr1[i] = pr1[i - 1] + fi1[i];
    pr1[i] %= 1000000009;
    pr2[i] = pr2[i - 1] + fi2[i];
    pr2[i] %= 1000000009;
  }
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    add(i, i, a[i], 0);
  }
  int t, l, r;
  while (m--) {
    scanf("%d%d%d", &t, &l, &r);
    if (t == 1) {
      add(l, r, 1, 1);
    } else {
      printf("%I64d\n", cal(l, r));
    }
  }
  return 0;
}
