#include <bits/stdc++.h>
using namespace std;
long long n, m, g, p, ans, e, s, i;
long long qsm(long long x, long long y) {
  long long i, j, k;
  j = y;
  i = x;
  k = 1;
  while (j != 0) {
    if (j % 2 == 1) k = (k * i) % p;
    i = (i * i) % p;
    j = j / 2;
  }
  return k;
}
int main() {
  cin >> n >> m >> g;
  p = 1000000007;
  if (m != 0) {
    e = m;
    for (i = n; i >= 1; i--) {
      if (i % 2 != g) ans = (ans + e) % p;
      s = n + 1 - i;
      e = e * (m + s) % p;
      e = e * qsm(s + 1, p - 2) % p;
    }
  }
  i = n;
  if (m > 1) i++;
  if (i % 2 != g) ans = (ans + 1) % p;
  cout << ans << endl;
  return 0;
}
