#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, j, k, n, m;
  string s;
  cin >> s;
  n = s.size();
  long long int ans = 0, t1 = 1;
  for (i = n - 1; i >= 0; i--) {
    ans = (ans * 2) % 1000000007;
    if (s[i] == '1') {
      ans = (ans + t1) % 1000000007;
    }
    t1 = (t1 * 4) % 1000000007;
  }
  cout << ans << endl;
  return 0;
}
