For a given polygon g, print "1" if g is a convex polygon, "0" otherwise. Here, in a convex polygon, all interior angles are less than or equal to 180 degrees.

g is represented by a sequence of points p1, p2,..., pn where line segments connecting pi and pi+1 (1 ≤ i ≤ n-1) are sides of the polygon. The line segment connecting pn and p1 is also a side of the polygon.

Constraints

* 3 ≤ n ≤ 100
* -10000 ≤ xi, yi ≤ 10000
* No point of the polygon will occur more than once.
* Two sides of the polygon can intersect only at a common endpoint.

Input

g is given by coordinates of the points p1,..., pn in the following format:


n
x1 y1
x2 y2
:
xn yn


The first integer n is the number of points. The coordinate of a point pi is given by two integers xi and yi. The coordinates of points are given in the order of counter-clockwise visit of them.

Output

Print "1" or "0" in a line.

Examples

Input

4
0 0
3 1
2 3
0 3


Output

1


Input

5
0 0
2 0
1 1
2 2
0 2


Output

0
#include <iostream>
#include <math.h>
#include <vector>

using namespace std;

class Vector {
public:
    double x, y;
    // コンストラクタ
    Vector() {
        x = 0.0;
        y = 0.0;
    }
    
    // xを設定する
    void setX(double nx) { x = nx; }
    // yを設定する
    void setY(double ny) { y = ny; }
    
    // コンストラクタ(引数あり)
    Vector(double nx, double ny) {
        x = nx;
        y = ny;
    }
    
    // x,yを設定する
    void set(double nx, double ny) {
        x = nx;
        y = ny;
    }
    
    // 大きさを求める
    double norm() const {
        return sqrt(x * x + y * y);
    }
    
    // 回転する
    void rotate(double radian) {
        x = x * cos(radian) - y * sin(radian);
        x = x * sin(radian) + y * cos(radian);
    }
    
    // 内積を求める
    double dot(const Vector& vec) const {
        return x * vec.x + y * vec.y;
    }
    
    // 外積を求める
    double cross(const Vector& vec) const {
        return x * vec.y - y * vec.x;
    }
    // 余弦を返す
    double getCos(const Vector& vec) const {
        double nor = norm() * vec.norm();
        if (nor == 0.0) {
            return 0.0;
        } else {
            return dot(vec) / nor;
        }
    }
    
    // 単位ベクトルを返す
    Vector getUnit() const {
        Vector v;
        double mag = norm();
        if (mag == 0.0) {
            v.set(0.0, 0.0);
        } else {
            v.set(x / mag, y / mag);
        }
        return v;
    }
    
    // ベクトル1をベクトル2に正射影したベクトルを求める
    Vector getProjection(const Vector& vec1, const Vector& vec2) {
        Vector vec(vec2.getUnit() * vec1.norm() * vec1.getCos(vec2));
        return vec;
    }
    
    void operator = (const Vector& vec) {
        x = vec.x;
        y = vec.y;
    }
    
    Vector operator + (const Vector& vec) const {
        Vector v(x + vec.x, y + vec.y);
        return v;
    }
    
    Vector operator - (const Vector& vec) const {
        Vector v(x - vec.x, y - vec.y);
        return v;
    }
    
    Vector operator * (const Vector& vec) const {
        Vector v(x * vec.x, y * vec.y);
        return v;
    }
    
    Vector operator * (double f) const {
        Vector v(x * f, y * f);
        return v;
    }
    
    Vector operator / (const Vector& vec) const {
        Vector v;
        if (vec.x == 0.0) {
            v.setX(0.0);
        } else {
            v.setX(x / vec.x);
        }
        
        if (vec.y == 0.0) {
            v.setY(0.0);
        } else {
            v.setY(y / vec.y);
        }
        return v;
    }
    
    Vector operator / (double f) const {
        Vector v;
        if (f == 0.0) {
            v.set(0.0, 0.0);
        } else {
            v.set(x / f, y / f);
        }
        return v;
    }
    
    void operator += (const Vector& vec) {
        x += vec.x;
        y += vec.y;
    }
    
    void operator -= (const Vector& vec) {
        x -= vec.x;
        y -= vec.y;
    }
    
    void operator *= (const Vector& vec) {
        x *= vec.x;
        y *= vec.y;
    }
    
    void operator /= (const Vector& vec) {
        if (vec.x == 0.0) {
            x = 0.0;
        } else {
            x /= vec.x;
        }
        
        if (vec.y == 0.0) {
            y = 0.0;
        } else {
            y /= vec.y;
        }
    }
    
    bool operator == (const Vector& vec) const {
        if (x == vec.x && y == vec.y) {
            return true;
        } else {
            return false;
        }
    }
};

class Polygon {
private:
    vector<Vector> vertex; // 頂点
public:
    // コンストラクタ
    Polygon() {}
    // 頂点を追加する
    void addVertex(const Vector& vec) {
        vertex.push_back(vec);
    }
    
    // 頂点配列を設定する
    void setVertex(const vector<Vector>& src) {
        vertex = src;
    }
    
    // 面積を計算する
    double calculateArea() {
        double sum = 0;
        for (int i = 0; i < vertex.size(); i++) {
            Vector vec1, vec2;
            vec1 = vertex[i];
            if (i == vertex.size() - 1) {
                vec2 = vertex[0];
            } else {
                vec2 = vertex[i + 1];
            }
            sum += vec1.cross(vec2);
        }
        return sum / 2.0;
    }
    
    // 凸多角形か
    bool isConvex() {
        for (int i = 0; i < vertex.size(); i++) {
            Vector ver1 = vertex[i];
            Vector ver2 = vertex[(i + 1) % vertex.size()];
            Vector ver3 = vertex[(i + 2) % vertex.size()];
            Vector edge1 = ver2 - ver1;
            Vector edge2 = ver3 - ver1;
            if (edge1.cross(edge2) < 0) { //
                return false;
            }
        }
        return true;
    }
};
