#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
string c;
int main() {
  cin >> c;
  int d = c.size();
  long long s = 0, p = 1;
  for (int i = 0; i < d; i++) {
    s <<= 2;
    if (c[i] == '1') s += p;
    p <<= 1;
    s %= MOD;
    p %= MOD;
  }
  cout << s;
  puts("");
}
