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