#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 5, mod = 1e9 + 7, inf = 0x3f3f3f3f;
using ll = long long;
int now;
char s[MAX];
int a[MAX], D[MAX];
ll dp[MAX];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s + 1;
  int n = strlen(s + 1);
  int z = 0, dem = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '0') {
      ++dem;
    } else {
      a[++z] = dem;
      dem = 0;
    }
  }
  if (dem == n) {
    cout << n;
    return 0;
  }
  a[++z] = dem;
  dp[z] = 1;
  int top = 0;
  ll ans = a[z] + 1;
  a[0] = -1;
  for (int i = z - 1; i > 0; i--) {
    dp[i] = ans;
    D[top + 1] = 0;
    while (top > 0 && a[D[top]] <= a[i]) {
      ans -= dp[D[top]] * (a[D[top]] - a[D[top + 1]]);
      ans %= mod;
      top--;
    }
    ans = (ans + dp[D[top]] * (a[D[top + 1]] - a[i])) % mod;
    if (ans < 0) ans += mod;
    D[++top] = i;
    ans = (ans + dp[D[top]] * (a[D[top]] + 1)) % mod;
  }
  cout << (dp[1] * (a[1] + 1)) % mod;
}
