#include<bits/stdc++.h>
using namespace std;
#define int               long long
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define ppc               __builtin_popcount
#define ppcll             __builtin_popcountll
#define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
 
template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a){in>>a.fr>>a.sc;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a){out<<a.fr<<" "<<a.sc;return out;}
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}

template<typename T_vector>
void output_vector(const T_vector &v, bool addOne = false, int start = -1, int end = -1) {
	if (start < 0) start = 0;
	if (end < 0) end = (int) v.size();
	for(int i = start; i < end; i++)
		cout<< v[i] + (addOne ? 1 : 0) << (i < end - 1 ? ' ' : '\n');
}
 
const long long INF=1e18;
const int32_t M=1e9+7;
const int32_t MM=998244353;
 

void solve() {
	int n;
	cin>>n;
	vector<int> v(n);
	rep(i,0,n) {
		cin>>v[i];
	}
	

	int sum = 0;
    
      
  sort(all(v));     
  
	for(int i = sz(v) - 1; i >=  0; i--){
	sum += (v[i]*(i)- v[i]*(n-i-1));
	}
  
 
	cout<<sum<<"\n";
}

signed main() {
	fast
	#ifndef ONLINE_JUDGE 
  
    // For getting input from input.txt file 
    freopen("input.txt", "r", stdin); 
  
    // Printing the Output to output.txt file 
    freopen("output.txt", "w", stdout); 
	
	cout<<setprecision(12);
	cout<<fixed;
	
	#endif 
	int t=1;
	//~ cin>>t;
	while(t--) solve();
	return 0;
}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define mm(arr) memset(arr, 0, sizeof(arr))
#define scanArray(a,n) for(int i = 0; i < n; i++){cin >> a[i];}
#define pb push_back
#define PI 3.141592653589793
#define MOD 1000000007

using namespace std;
int main(){
    FAST
    int n; cin >>n;
    double x1,y1,x2,y2,x3,y3;
    double x[n];
    double y[n];
    bool result=false;
    for(int i=0;i <n; i++){
        cin >> x[i];
        cin >> y[i];
    }
    for(int i=0; i<n ;i++){
        for(int j=i+1; j<n; j++){
            for(int k=j+1; k<n; k++){
                x1=x[i];x2=x[j];x3=x[k];y1=y[i];y2=y[j];y3=y[k];
                if(x3-x2==0&& x3-x1==0){
                    result=true;}
                else{
                    if((y3-y2)/(x3-x2)==(y3-y1)/(x3-x1)){
                        result=true;
                        break;
                    }

                }
            }
        }
    }
    if(result)
        cout << "Yes";
    else
        cout << "No";

    return 0;
}
