#include <bits/stdc++.h>
using namespace std;
const double g = 10.0, eps = 1e-12;
const int N = 3000 + 10, maxn = 90000 + 10, inf = 0x3f3f3f3f;
long long quick(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 1000000007;
    a = a * a % 1000000007;
    b /= 2;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, k;
  cin >> n >> m >> k;
  if (n % 2 != m % 2 && k == -1) {
    cout << 0 << endl;
    return 0;
  }
  long long ans = quick(2, n - 1);
  ans = quick(ans, m - 1);
  cout << ans << endl;
  return 0;
}
