#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
long long pw(long long x, long long e) {
  if (e == 0) return 1;
  long long val = pw(x, e / 2);
  val = (val * val) % MOD;
  if (e & 1) val = (val * x) % MOD;
  return val;
}
void solve() {
  long long n, m, k;
  cin >> n >> m >> k;
  if ((n + m) % 2 == 1 && k == -1) {
    cout << 0;
    return;
  }
  long long a = pw(2, n - 1);
  long long b = pw(a, m - 1);
  cout << b;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
