#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
char second[1000];
int pw[10000];
int n;
int main() {
  scanf("%s", second);
  int n = strlen(second);
  pw[0] = 1;
  for (int i = 1; i <= n; ++i) {
    pw[i] = (pw[i - 1] * 1ll * 2) % mod;
  }
  int ans = 0;
  for (int i = 0; i < n; ++i)
    if (second[i] == '1') {
      int tmp = pw[i];
      tmp = (tmp * 1ll * pw[n - i - 1]) % mod;
      tmp = (tmp * 1ll * pw[n - i - 1]) % mod;
      ans = (ans + tmp) % mod;
    }
  cout << ans << endl;
  return 0;
}
