#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<v> vv;
typedef vector<vv> vvv;
typedef pair<ll, ll> p;
typedef vector<p> vp;
typedef vector<vp> vvp;
typedef vector<vvp> vvvp;
typedef pair<ll, p> tri;
typedef vector<tri> vtri;
typedef vector<vtri> vvtri;
typedef vector<vvtri> vvvtri;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<vvb> vvvb;
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
const ll INF = 1e18;
const ll mod = 1e9 + 7;
#include "hexagon.h"
struct Hex
{
ll a, b, c;
Hex() {a = 0; b = 0; c = 0;}
Hex(ll a, ll b, ll c) : a(a), b(b), c(c) {}
Hex operator+(Hex other)
{
return Hex(a + other.a, b + other.b, c + other.c);
}
Hex operator+=(Hex other)
{
a += other.a; b += other.b; c += other.c;
}
Hex operator-(Hex other)
{
return Hex(a - other.a, b - other.b, c - other.c);
}
Hex operator-=(Hex other)
{
a -= other.a; b -= other.b; c -= other.c;
}
Hex operator-()
{
return Hex() - *this;
}
};
int draw_territory(int N, int A, int B, std::vector<int> D, std::vector<int> L) {
return (A * ((L[0] * (L[0] + 1)) / 2)) % mod;
}
/*
int main() {
int N, A, B;
assert(3 == scanf("%d %d %d", &N, &A, &B));
std::vector<int> D(N), L(N);
for (int i = 0; i < N; ++i) {
assert(2 == scanf("%d %d", &D[i], &L[i]));
}
int result = draw_territory(N, A, B, D, L);
printf("%d\n", result);
return 0;
}
/**/