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