#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 5e5 + 10;
long long bigMod(long long n, long long r) {
  if (r == 0) return 1LL;
  long long ret = bigMod(n, r / 2);
  ret = (ret * ret) % mod;
  if (r % 2 == 1) ret = (ret * n) % mod;
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long m, n, k;
  cin >> n >> m >> k;
  long long ans = bigMod(2, n - 1);
  ans = bigMod(ans, m - 1);
  if (n % 2 != m % 2 && k == -1) ans = 0;
  cout << ans << endl;
  return 0;
}
