#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define REP(i,a,b) for(int i = (a); i < (b); i++)
#define MOD 1000000007

int main(void) {
  int n;
  cin >> n;
  int res;
  // 1/2 res (res+1) >= n
  // res (res+1) >= 2n
  for(res=0; res<n; res++) {
    if(res*(res+1)/2 >= n) break;
  }
  cout << res << endl;
}
#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <bitset>
#include <stack>
#include <deque>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;

const LL MOD = (LL)1e9 + 7;

LL mul(LL a, LL b) {
    return (a * b) % MOD;
}

int main() {
    int N;
    scanf("%d", &N);
    vector<int> A;
    for (int i = 0; i < N; i++) {
        int tmp;
        scanf("%d", &tmp);
        A.push_back(tmp);
    }
    sort(A.begin(), A.end());
    A.erase(unique(A.begin(), A.end()), A.end());
    int pre = 0;
    LL ans = 1;
    for (int i : A) {
        int dif = i - pre;
        ans = mul(ans, dif + 1);
        pre = i;
    }
    printf("%lld\n", ans);
    return 0;
}
