#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long pw(long long base, long long x) {
  if (x == 0) return 1;
  if (x % 2) return (base * pw(base, x - 1)) % mod;
  return pw((base * base) % mod, x / 2) % mod;
}
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  if (n % 2 != m % 2 && k == -1) {
    puts("0");
  } else {
    cout << pw(pw(2, n - 1), m - 1);
  }
  return 0;
}
