#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define pii pair<ll,ll>
#define inf 1000000000000000000
#define bpc(x) __builtin_popcountll(x)
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define autoitr(x,it) for(auto it = x.rbegin(); it != x.rend(); it++)
#define rep(n) for(ll i = 0; i < n; i++)
#define repi(i,n) for(ll i = 0; i < n; i++)
#define hmap gp_hash_table<ll, ll>

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 

using namespace std;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
  FAST/**/
  
  ll n;
  cin>>n;
  
  ll arr[n];
  map<ll,ll> ma;
  rep(n)
        cin>>arr[i], ma[arr[i]] = 1;
  ma[0] = 1;
  vector<ll> v;
  autoit(ma,it)
  {
      v.pb(it->ff);
  }
  
  ll ans = 1;
  for(ll i=1;i<v.size();i++)
        ans = (ans * (v[i]-v[i-1]+1))%mod;
  cout<<ans<<"\n";        
  
  return 0;
}
   
   
 
#include <bits/stdc++.h>
# define INF32 2147483647
# define INF64 9223372036854775807
# define rep(i,l,n) for(int i=l,i##_end=n;i<i##_end;++i)
# define rrep(i,n,l) for(int i=((int)(n)-1),i##_end=l;i>=i##_end;--i)
# define erep(i,n) for(auto &i : n)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define _f_ first
# define _s_ second
using namespace std;
using ll = long long;
using ull = unsigned long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
    // 1. input
    ll N,X;
    cin>>N>>X;

    // 2.
    // 3. output
    rep(i,0,N){
        ll a = 0;
        cin>>a;
        if(a == X) continue;
        cout << a << endl;
    }
    
    return 0;
}