#include <bits/stdc++.h>
using namespace std;
template <typename T, typename L>
inline bool smax(T &x, L y) {
  return x < y ? (x = y, true) : false;
}
template <typename T, typename L>
inline bool smin(T &x, L y) {
  return y < x ? (x = y, true) : false;
}
constexpr int MAXN = 256;
constexpr int MOD = 1e9 + 7;
string s;
long long ans;
long long pw[MAXN];
int main() {
  cin >> s;
  pw[0] = 1;
  for (int i = 1; i < MAXN; i++) {
    pw[i] = (pw[i - 1] << 1) % MOD;
  }
  for (int i = (int)s.size() - 1; ~i; i--) {
    if (s[i] == '0') {
      ans = (ans << 1) % MOD;
    } else {
      ans = ((ans << 1) + pw[((s.size() - i - 1) << 1)]) % MOD;
    }
  }
  return cout << ans << '\n', false;
}
