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