#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long p[10000], n, i, ans;
string s;
int main() {
  p[0] = 1;
  for (i = 1; i <= 1000; i++) p[i] = (p[i - 1] * 2) % MOD;
  cin >> s;
  n = s.size();
  for (i = n - 1; i >= 0; i--)
    if (s[i] == '1') ans = (ans + p[2 * n - i - 2]) % MOD;
  cout << ans << endl;
}
