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