#include <bits/stdc++.h>
using namespace std;
long long fast(long long a, int b) {
  long long ans = 1LL;
  while (b > 0) {
    if (b & 1) ans = (ans * a) % 1000000007;
    b >>= 1;
    a = (a * a) % 1000000007;
  }
  return ans;
}
int main() {
  string s;
  cin >> s;
  long long ans = 0LL, n = fast(2LL, s.length() - 1);
  long long p = 1LL;
  for (int i = s.length() - 1; i >= 0; i--) {
    if (s[i] == '1') ans = (ans + (n * p) % 1000000007) % 1000000007;
    p = (p * 2) % 1000000007;
  }
  cout << ans << '\n';
  return 0;
}
