#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
string s;
long long p2[400 + 10] = {1}, ans;
int main() {
  for (int i = 1; i <= 400; i++) p2[i] = p2[i - 1] * 2 % mod;
  cin >> s;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == '1') ans = (ans + p2[2 * s.size() - i - 2]) % mod;
  cout << ans << '\n';
  return 0;
}
