#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int SIZE = 1e6 + 5;
const long long INF = 1LL << 58;
const double eps = 1e-13;
string s;
int dist[1000009];
int nxt[1000009];
long long dp[1000009];
int main() {
  cin >> s;
  int suf0 = 0;
  while (((int)(s).size()) && s.back() == '0') {
    s.pop_back();
    suf0++;
  }
  if (s.empty()) {
    cout << suf0;
    return 0;
  }
  int n = ((int)(s).size());
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '0') dist[i] = (i ? dist[i - 1] : 0) + 1;
  }
  for (int i = 0; i < (n); ++i) nxt[i] = n;
  for (int i = n - 1; i >= 0; i--) {
    dp[i] = (dp[i] + (s[i] == '1') + dp[nxt[0]] + dp[nxt[dist[i] + 1]]) % MOD;
    nxt[dist[i]] = i;
  }
  long long ans = n;
  if (nxt[0] < n) {
    ans = (dp[nxt[0]] * (nxt[0] + 1)) % MOD;
  }
  ans = (ans * (suf0 + 1)) % MOD;
  printf("%lld", ans);
}
