#include <bits/stdc++.h>
using namespace std;
long long test(long long x, long long y) {
  long long ans = 1;
  x %= 1000000007;
  while (y != 0) {
    if (y % 2 == 1) ans = (ans * x) % 1000000007;
    x = (x * x) % 1000000007;
    y = y / 2;
  }
  return ans;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, k;
  cin >> n >> m >> k;
  if ((n + m) % 2 == 1 && k == -1)
    cout << 0 << endl;
  else
    cout << test(test(2, (n - 1)), m - 1) << endl;
  return 0;
}
