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 <bits/stdc++.h>
using namespace std;
class Vector {
 public:
  double x, y;
  Vector() {
    x = 0.0;
    y = 0.0;
  }
  void setX(double nx) { x = nx; }
  void setY(double ny) { y = ny; }
  Vector(double nx, double ny) {
    x = nx;
    y = ny;
  }
  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;
  }
  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() {
    Vector v1 = vertex[1] - vertex[0];
    Vector v2 = vertex[2] - vertex[1];
    double base = v1.cross(v2);
    for (int i = 1; i < vertex.size() - 1; 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) * base < 0) {
        return false;
      }
    }
    return true;
  }
};
int main(int argc, const char* argv[]) {
  int n;
  cin >> n;
  Polygon poly;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    Vector v(x, y);
    poly.addVertex(v);
  }
  cout << poly.isConvex() << endl;
  return 0;
}
