#include <bits/stdc++.h>
using namespace std;
const unsigned long long Modder = 1000000007ull;
unsigned long long mod_pow(unsigned long base, unsigned long long exponent) {
  if (exponent == 0)
    return 1;
  else {
    unsigned long long half_power = mod_pow(base, exponent / 2);
    unsigned long long power = (half_power * half_power) % Modder;
    if (exponent % 2 == 1) power = (power * base) % Modder;
    return power;
  }
}
int main(void) {
  unsigned long long n, m, result;
  int k;
  cin >> n >> m >> k;
  if (k == -1 && n % 2 != m % 2) {
    cout << 0 << '\n';
  } else {
    result = mod_pow(2, (n - 1)) % Modder;
    result = mod_pow(result, (m - 1)) % Modder;
    cout << result << '\n';
  }
  return 0;
}
