#include <bits/stdc++.h>
using namespace std;
const long long p = 1000000007;
int n;
long long ans;
char ch[101];
int main() {
  cin >> ch;
  n = strlen(ch);
  long long tmp = 1;
  for (int i = 0; i < n - 1; i++) tmp = (tmp * 2) % p;
  for (int i = n - 1; i >= 0; i--) {
    if (ch[i] == '1') {
      ans += tmp;
      ans %= p;
    }
    tmp *= 2;
    tmp %= p;
  }
  cout << ans % p << endl;
  return 0;
}
