#include <bits/stdc++.h>
using namespace std;
long long f[1000005], ans = 0;
int n, st, p[1000005], d[1000005], g[1000005], h[1000005];
char s[1000005];
void A(long long &x, long long y) {
  x += y;
  if (x > 1000000007) x -= 1000000007;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  p[0] = n + 1;
  for (register int i = 1; i <= n; i++) {
    p[i] = n + 1, d[i] = d[i - 1] + 1;
    if (s[i] == '1') {
      if (!st) st = i;
      d[i] = 0;
    }
  }
  if (!st) {
    printf("%d\n", n);
    return 0;
  }
  f[st] = st;
  for (register int i = n; i >= 1; i--) {
    g[i] = p[d[0]];
    h[i] = p[d[i] + 1];
    p[d[i]] = i;
  }
  for (register int i = st; i <= n; i++) {
    if (g[i] <= n) A(f[g[i]], f[i]);
    if (h[i] <= n) A(f[h[i]], f[i]);
  }
  for (register int i = 1; i <= n; i++)
    if (d[i] <= d[n]) A(ans, f[i]);
  printf("%lld\n", ans);
  return 0;
}
