#include <bits/stdc++.h>
using namespace std;
int n, ans;
string s;
int pows(int x) {
  int tmp = 1;
  for (int j = 0; j < x; j++) tmp = (tmp * 2) % 1000000007;
  return tmp;
}
int main() {
  cin >> s;
  int nn = s.length();
  ans = pows(2 * nn - 1);
  ans = ((ans + 1000000007) - pows(nn - 1)) % 1000000007;
  for (int i = s.length() - 1; i >= 0; i--) {
    if (s[i] == '0') {
      ans = ((ans + 1000000007) - pows(nn - 1 + n)) % 1000000007;
    }
    n++;
  }
  cout << ans << endl;
  return 0;
}
