#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long n, m;
int k;
int mpow(int a, long long b) {
  int c = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) c = 1ll * c * a % mod;
  return c;
}
int main() {
  scanf("%lld%lld%d", &n, &m, &k);
  if ((n + m) & 1)
    if (k == -1) {
      printf("0\n");
      return 0;
    }
  int tmp = mpow(2, n - 1);
  printf("%d\n", mpow(tmp, m - 1));
}
