#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int n = s.size(), cum = 0;
  reverse(s.begin(), s.end());
  vector<long long int> arr(n, 1);
  for (long long int i = 1; i < n; i++) arr[i] = (2 * arr[i - 1]) % 1000000007;
  vector<long long int> ans(n, 0);
  for (long long int i = 0; i < s.size(); i++) {
    long long int val = 0;
    if (s[i] == '1') val = (val + (arr[i] * arr[i]) % 1000000007) % 1000000007;
    for (long long int j = 0; j < i; j++) val = (val + ans[j]) % 1000000007;
    ans[i] = val;
  }
  long long int res = 0;
  for (long long int i = 0; i < n; i++) res = (res + ans[i]) % 1000000007;
  cout << res;
  return 0;
}
