#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10, skc = 1e9 + 7;
string s;
int a[N], b[N], n = 1, sum[N], f[N], nw[N];
void upd(int &x, int y) { x = (x + y) % skc; }
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> s;
  int l = s.length();
  s = ' ' + s;
  bool flag = 0;
  for (register int i = (1); i <= (l); ++i) flag |= (s[i] == '1');
  if (flag == 0) {
    cout << l << '\n';
    return 0;
  }
  for (register int i = (1); i <= (l); ++i)
    if (s[i] == '0')
      a[n]++;
    else
      n++;
  int ans = 1ll * (a[1] + 1) * (a[n] + 1) % skc;
  n--;
  sum[1] = f[1] = 1;
  for (register int i = (2); i <= (n); ++i) {
    for (register int j = (0); j <= (a[i]); ++j)
      upd(f[i], (sum[i - 1] - sum[nw[j] - 1] + skc) % skc);
    for (register int j = (0); j <= (a[i]); ++j) nw[j] = i;
    sum[i] = (sum[i - 1] + f[i]) % skc;
  }
  cout << 1ll * ans * sum[n] % skc << '\n';
  return 0;
}
