```
class Solution {
public:
bool isConvex(vector<vector<int>>& points) {
int n = points.size();
long check = 0;
bool positive = false;
bool negative = false;
for(int i = 0; i < n; ++i){
auto A = points[i];
auto B = points[(i+1)%n];
auto C = points[(i+2)%n];
long tmp = CrossProduct(A,B,C);
if(tmp > 0) positive = true;
if(tmp < 0) negative = true;
if(positive && negative) return false;
}
return true;
```

}

```
int CrossProduct(vector<int>& A, vector<int>& B, vector<int>& C){
int X_AB = B[0] - A[0];
int Y_AB = B[1] - A[1];
int X_AC = C[0] - A[0];
int Y_AC = C[1] - A[1];
return X_AB*Y_AC - X_AC * Y_AB;
```

}

};