#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
const long long MOD = 1000000007;
long long expmod(long long b, long long e, long long m) {
  if (!e) return 1;
  long long q = expmod(b, e / 2, m);
  q = (q * q) % m;
  return e % 2 ? (b * q) % m : q;
}
int main() {
  cin >> n >> m >> k;
  if (k == -1 && (n % 2 != m % 2)) {
    cout << "0\n";
    return 0;
  }
  long long dos_a_la_ene = (expmod(2, n - 1LL, MOD)) % MOD;
  cout << expmod(dos_a_la_ene, m - 1LL, MOD) % MOD << "\n";
}
