#include <bits/stdc++.h>
using namespace std;
long long solve(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    a %= 1000000007;
    if (b & 1) ans = (ans * a) % 1000000007;
    b /= 2;
    a = (a * a) % 1000000007;
  }
  return ans;
}
int main() {
  long long n, m;
  int k;
  cin >> n >> m >> k;
  if (n > m) swap(n, m);
  if (n % 2 != m % 2 && k == -1)
    cout << "0" << endl;
  else {
    long long ans = 0;
    ans = solve(2, n - 1);
    ans = solve(ans, m - 1);
    cout << ans << endl;
  }
  return 0;
}
