#include <bits/stdc++.h>
char s[1048576];
int a[1048576];
std::pair<int, int> st[1048576];
int main() {
  int n = 0;
  int base = 0;
  scanf("%s", s);
  {
    int i = 0;
    while (s[i] == '0') ++base, ++i;
    if (s[i] == 0) return printf("%d\n", base), 0;
    assert(s[i] == '1');
    ++i;
    int cnt = 0;
    while (s[i]) {
      assert(s[i] == '0' || s[i] == '1');
      ++cnt;
      if (s[i] == '1') {
        a[n++] = cnt;
        cnt = 0;
      }
      ++i;
    }
    base = (long long int)(base + 1) * (cnt + 1) % ((int)1e9 + 7);
  }
  int ns = 0;
  st[ns++] = {0, 1};
  for (int i = 0; i < n; ++i) {
    int cz = 0, cnt = 0;
    while (ns && st[ns - 1].first <= a[i]) {
      int k, c;
      std::tie(k, c) = st[--ns];
      cz = (cz + (long long int)(a[i] - k) * c) % ((int)1e9 + 7);
      cnt = (cnt + c) % ((int)1e9 + 7);
    }
    st[ns++] = {a[i], cnt};
    st[ns++] = {0, cz};
    0;
  }
  int ans = 0;
  while (ns) ans = (ans + st[--ns].second) % ((int)1e9 + 7);
  ans = (long long int)ans * base % ((int)1e9 + 7);
  printf("%d\n", ans);
  return 0;
}
