#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  long long ans = 0, tmp = 1, tp = 1;
  for (int i = 1; i < s.size(); i++) tmp = tmp * 2 % M;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '1') ans = (ans + (tmp * tp) % M) % M;
    tp = 2 * tp % M;
  }
  cout << ans << endl;
}
