#include <bits/stdc++.h>
using namespace std;
string s;
long long int x = 0, M = 1e+9 + 7, ans = 1;
long long int po(int i) {
  if (i == 0) return 1;
  long long int a = po(i / 2);
  a = (a * a) % M;
  if (i % 2 == 1) a = (a * 2) % M;
  return a;
}
int main() {
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    x = (x * 2) % M;
    x = (x + s[i] - '0') % M;
  }
  ans = (x * po(s.size() - 1)) % M;
  cout << ans;
  return 0;
}
