Ayoub had an array a of integers of size n and this array had two interesting properties: 

  * All the integers in the array were between l and r (inclusive). 
  * The sum of all the elements was divisible by 3. 



Unfortunately, Ayoub has lost his array, but he remembers the size of the array n and the numbers l and r, so he asked you to find the number of ways to restore the array. 

Since the answer could be very large, print it modulo 10^9 + 7 (i.e. the remainder when dividing by 10^9 + 7). In case there are no satisfying arrays (Ayoub has a wrong memory), print 0.

Input

The first and only line contains three integers n, l and r (1 ≤ n ≤ 2 ⋅ 10^5 , 1 ≤ l ≤ r ≤ 10^9) — the size of the lost array and the range of numbers in the array.

Output

Print the remainder when dividing by 10^9 + 7 the number of ways to restore the array.

Examples

Input


2 1 3


Output


3


Input


3 2 2


Output


1


Input


9 9 99


Output


711426616

Note

In the first example, the possible arrays are : [1,2], [2,1], [3, 3].

In the second example, the only possible array is [2, 2, 2].
#include <bits/stdc++.h>
using namespace std;
void print_pair(pair<long long, long long> a) {
  cerr << "(" << a.first << ", " << a.second << ") ";
}
template <int T1, int T2>
void print_2d(int a[T1][T2], int x, int y) {
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < y; j++) {
      cerr << a[i][j] << " ";
    }
    cerr << endl;
  }
}
template <class T>
void print_array(T a[], size_t n) {
  cerr << "array:";
  for (int i = 0; i < n - 1; i++) cerr << a[i] << ",";
  cerr << a[n - 1] << endl;
}
long long n, l, r;
long long num[3];
long long mod_pow[3][200001];
const long long MOD = 1e9 + 7;
long long dp[3][200001];
int main() {
  cin >> n >> l >> r;
  if (l == r) {
    if (n * l % 3 != 0) {
      cout << 0 << endl;
      return 0;
    } else {
      cout << 1 << endl;
      return 0;
    }
  }
  if (r - l < 2) {
    num[r % 3] = 1;
    num[l % 3] = 1;
  } else {
    long long l3 = l + (l % 3 == 0 ? 0 : 3 - l % 3);
    long long r3 = r - r % 3;
    num[0] = (r3 - l3 + 3) / 3;
    num[1] = num[0] + (l3 - l >= 2 ? 1 : 0) + (r - r3 >= 1 ? 1 : 0) - 1;
    num[2] = num[0] + (l3 - l >= 1 ? 1 : 0) + (r - r3 >= 2 ? 1 : 0) - 1;
  }
  for (int i = 0; i < 3; i++) {
    mod_pow[i][0] = 1;
    for (int j = 1; j < 200001; j++) {
      mod_pow[i][j] = mod_pow[i][j - 1] * num[i] % MOD;
    }
  }
  dp[0][0] = num[0] % MOD;
  dp[1][0] = num[1] % MOD;
  dp[2][0] = num[2] % MOD;
  ;
  ;
  ;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < 3; j++) {
      dp[j][i] = dp[0][i - 1] * num[j] % MOD +
                 dp[1][i - 1] * num[(2 + j) % 3] % MOD +
                 dp[2][i - 1] * num[(1 + j) % 3] % MOD;
      dp[j][i] %= MOD;
    };
    ;
    ;
  }
  cout << dp[0][n - 1] << endl;
  return 0;
}
