#include <bits/stdc++.h>
using namespace std;
const int MX = 1000005, mod = 1000000007;
int n, sig[MX], f, suf;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  n = s.size();
  sig[n] = -1;
  for (int i = n - 1; i >= 0; i--) {
    sig[i] = sig[i + 1];
    if (s[i] == '1') sig[i] = i, f = 1;
  }
  if (!f) {
    cout << n << '\n';
    return 0;
  }
  for (int i = n - 1; i >= 0 && s[i] == '0'; i--, suf++)
    ;
  long long acu = 0, last = 0, cn = 0;
  stack<pair<int, int> > st;
  for (int i = n - 1 - suf; i >= sig[0]; i--) {
    (acu += last) %= mod;
    if (s[i] == '0') {
      cn++;
      if (st.size()) {
        (acu -= st.top().second) %= mod;
        if (cn == st.top().first) st.pop();
      }
    } else {
      long long t = acu;
      if (cn) st.emplace(cn, last);
      (acu -= last) %= mod;
      last = (t + suf + 1) % mod;
      cn = 0;
    }
    if (i == sig[0])
      cout << (((((i + 1) * last) % (mod)) + (mod)) % (mod)) << '\n';
  }
  return 0;
}
