#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MOD2 = MOD - 1;
long long pM(long long e) {
  if (!e) return 1;
  long long m = pM(e / 2);
  return (e & 1 ? (m * m) % MOD * 2 : m * m) % MOD;
}
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  if (((n + m) & 1) && k == -1) {
    puts("0");
    return 0;
  }
  n = (n - 1) % MOD2;
  m = (m - 1) % MOD2;
  cout << pM(n * m % MOD2) << endl;
}
