#include<bits/stdc++.h>
#define FILE "read"
#define MAXN 50010
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
using namespace std;
typedef long long ll;
const int mod=1e7;
int n,ans,maxx,minn,a[MAXN],hash[mod+10];
inline int read(){
int x=0,f=1; char ch=getchar();
while(ch>'9'||ch<'0') {if(ch=='-') f=-1; ch=getchar();}
while(ch>='0'&&ch<='9') {x=x*10+ch-'0'; ch=getchar();}
return x*f;
}
void Special_check(){
int ret=1; sort(a+1,a+n+1);
for(int i=1;i<=n;++i){
if(a[i]==a[i-1]) ++ret;
else cmax(ans,ret),ret=1;
}
}
int Hash(int x){
int pos=x%mod; if(!pos) pos=mod;
while(hash[pos]&&hash[pos]!=x) pos=pos%mod+1;
return pos;
}
int find(int x){return hash[Hash(x)]==x;}
int main(){
n=read(); minn=2e9;
for(int i=1;i<=n;++i) a[i]=read();
for(int i=1;i<=n;++i){
cmax(maxx,a[i]);
cmin(minn,a[i]);
}
Special_check();
for(int i=1;i<=n;++i) hash[Hash(a[i])]=a[i];
for(int i=1;i<=n;++i)for(int j=i+1;j<=n;++j){
int D=a[j]-a[i],cur=2,ret=a[j];
if((ll)a[i]+(ll)ans*D>maxx) continue;
while(find(ret+D)) ++cur,ret+=D;
cmax(ans,cur);
}
if(ans<200) puts("No Solution");
else printf("%d\n",ans);
return 0;
}