#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 5, mod = 1e9 + 7;
long long n, st, d[N], pos[N], nxt_1[N], nxt_d[N], f[N], ans;
char s[N];
signed main() {
  scanf("%s", s + 1), n = strlen(s + 1);
  for (long long i = 1; i <= n; i++)
    if (s[i] == '1') {
      st = i;
      break;
    }
  if (!st) printf("%lld\n", n), exit(0);
  for (long long i = 1; i <= n; i++) {
    if (s[i] == '0')
      d[i] = d[i - 1] + 1;
    else
      d[i] = 0;
  }
  for (long long i = 0; i <= n + 1; i++) pos[i] = n + 1;
  for (long long i = n; i >= 1; i--)
    nxt_1[i] = pos[0], nxt_d[i] = pos[d[i] + 1], pos[d[i]] = i;
  f[st] = st;
  for (long long i = st; i < n; i++) {
    if (nxt_1[i] != n + 1) f[nxt_1[i]] = (f[nxt_1[i]] + f[i]) % mod;
    if (nxt_d[i] != n + 1) f[nxt_d[i]] = (f[nxt_d[i]] + f[i]) % mod;
  }
  for (long long i = st; i <= n; i++)
    if (d[i] <= d[n]) ans = (ans + f[i]) % mod;
  printf("%lld\n", ans);
  return 0;
}
