#include <bits/stdc++.h>
using namespace std;
char str[110];
long long ans = 0;
int main() {
  cin >> str;
  int ll = strlen(str);
  long long k = 1, l = 1;
  for (int i = 1; i < ll; i++) {
    l = (l % 1000000007 * 2) % 1000000007;
  }
  k = l;
  for (int i = ll - 1; i >= 0; i--) {
    if (str[i] == '1') ans = (ans % 1000000007 + k % 1000000007) % 1000000007;
    k = (k % 1000000007 * 2) % 1000000007;
  }
  cout << ans;
  return 0;
}
