#include <bits/stdc++.h>
using namespace std;
long long mypow(int a) {
  if (a == 0) return 1;
  if (a == 1) return 2;
  long long tmp = mypow(a / 2);
  tmp = (tmp * tmp) % 1000000007;
  if (a % 2 == 1) tmp = (tmp * 2) % 1000000007;
  return tmp;
}
int main() {
  string str;
  while (cin >> str) {
    long long ans = 0;
    int len = str.size();
    for (int i = 0; i < len; ++i) {
      if (str[i] == '1') {
        int before = i;
        int after = len - i - 1;
        ans = (ans + (long long)mypow(before) * (long long)mypow(after) %
                         1000000007 * (long long)mypow(after) % 1000000007) %
              1000000007;
      }
    }
    cout << ans << endl;
  }
}
