#include <bits/stdc++.h>
using namespace std;
long long fun(long long x, long long y);
int main() {
  long long m, n, k, ans;
  scanf("%lld %lld %lld", &m, &n, &k);
  if ((m + n) & 1) {
    if (k == -1)
      ans = 0;
    else {
      m--;
      n--;
      ans = fun(2, m);
      ans = fun(ans, n);
    }
  } else {
    m--;
    n--;
    ans = fun(2, m);
    ans = fun(ans, n);
  }
  printf("%lld\n", ans);
  return 0;
}
long long fun(long long x, long long y) {
  x = x % 1000000007;
  long long res = 1;
  while (y) {
    if (y & 1) res = (res * x) % 1000000007;
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res;
}
