#include using namespace std; long long gcd2(long long a,long long b) { if(a == 0 || b == 0) { return max(a,b); } if(a % b == 0) { return b; } else { return gcd2(b,a % b); } } int main() { int N; cin >> N; vectorA(N); for(int i = 0; i < N; i++) { cin >> A[i]; } sort(A.begin(),A.end()); long long g = -1; for(int i = 0; i+1 < N; i++) { if(A[i] == 0) { continue; } if(g == -1) { g = A[i+1]-A[i]; } else if(g == 0 || A[i+1]-A[i] == 0) { if(g == 0 && A[i+1]-A[i] == 0) { continue; } cout << "No" << endl; return 0; } else { g = gcd2(g,A[i+1]-A[i]); } } if(g == 0) { cout << "Yes" << endl; } else { int ans = 0; for(int i = 0; i+1 < N; i++) { if(A[i] == 0) { ans--; } else { ans += (A[i+1]-A[i])/g-1; } } cout << ((ans <= 0)?"Yes":"No") << endl; } }