#include <bits/stdc++.h>
using namespace std;
int64_t M = 1e9 + 7, F[1 << 20], x, y, g;
int64_t P(int64_t a, int64_t b) {
  return (!b ? 1
             : (b & 1 ? a * P(a * a % M, b / 2) % M : P(a * a % M, b / 2) % M));
}
int64_t C(int64_t k, int64_t n) {
  if (n == k || k == 0) return 1;
  return F[n] * P(F[k], M - 2) % M * P(F[n - k], M - 2) % M;
}
int64_t f(int64_t x) {
  if (x == 0 && y == 1) return 1;
  if ((x == 0 && y > 1) || (x == 1 && y == 0)) return 0;
  return (C(y, x + y - 1) - f(x - 1) + M) % M;
}
int main() {
  F[0] = 1;
  for (int64_t i = 1; i < 1e6; i++) F[i] = F[i - 1] * i % M;
  cin >> x >> y >> g;
  if (g)
    cout << f(x);
  else
    cout << (C(x, x + y) - f(x) + M) % M;
}
