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>
typedef struct point {
  double x, y;
} point;
typedef struct line {
  point st, en;
} line;
double norm(point a);
double norm2(point a);
double distans(point a, point b);
point sum_vector(point a, point b);
point diff_vector(point a, point b);
point minus_vector(point a);
point prod_vector(point a, double t);
double dot(point a, point b);
double cross(point a, point b);
point reflection(line a, point p);
point projection(line a, point p);
int ccw(line a, point p);
int parallel(line a, line b);
int orthogonal(line a, line b);
int intersection(line a, line b);
point cross_point(line a, line b);
double distanceLP(line a, point b);
double distanceLL(line a, line b);
double area(int n, point ps[]);
int isConvex(int n, point ps[]);
double fmin(double a, double b);
double fmin(double a, double b) { return a < b ? a : b; }
double norm(point a) { return sqrt((a.x * a.x) + (a.y * a.y)); }
double norm2(point a) { return (a.x * a.x) + (a.y * a.y); }
double distans(point a, point b) {
  point tmp = sum_vector(b, minus_vector(a));
  return norm(tmp);
}
point sum_vector(point a, point b) {
  a.x += b.x;
  a.y += b.y;
  return a;
}
point diff_vector(point a, point b) {
  a.x -= b.x;
  a.y -= b.y;
  return a;
}
point prod_vector(point a, double t) {
  a.x *= t;
  a.y *= t;
  return a;
}
point minus_vector(point a) {
  a.x *= -1;
  a.y *= -1;
  return a;
}
double dot(point a, point b) { return (a.x * b.x) + (a.y * b.y); }
double cross(point a, point b) { return (a.x * b.y) - (b.x * a.y); }
point reflection(line a, point p) {
  return sum_vector(projection(a, p), diff_vector(projection(a, p), p));
}
point projection(line a, point p) {
  point h;
  double k = dot(diff_vector(a.st, p), diff_vector(a.st, a.en)) /
             dot(diff_vector(a.en, a.st), diff_vector(a.en, a.st));
  h.x = k * (a.en.x - a.st.x) + a.st.x;
  h.y = k * (a.en.y - a.st.y) + a.st.y;
  return h;
}
int ccw(line a, point p) {
  int cls = cross(diff_vector(a.en, a.st), diff_vector(p, a.st));
  if (cls > 0) {
    return 1;
  } else if (cls < 0) {
    return -1;
  } else if (dot(diff_vector(a.en, a.st), diff_vector(p, a.st)) < 0) {
    return 2;
  } else if (norm(diff_vector(a.st, a.en)) < norm(diff_vector(a.st, p))) {
    return -2;
  } else {
    return 0;
  }
}
int parallel(line a, line b) {
  if (!cross(diff_vector(a.en, a.st), diff_vector(b.en, b.st))) {
    return 1;
  } else {
    return 0;
  }
}
int orthogonal(line a, line b) {
  if (!dot(diff_vector(a.en, a.st), diff_vector(b.en, b.st))) {
    return 1;
  } else {
    return 0;
  }
}
int intersection(line a, line b) {
  if (ccw(a, b.st) * ccw(a, b.en) <= 0 && ccw(b, a.st) * ccw(b, a.en) <= 0) {
    return 1;
  } else {
    return 0;
  }
}
point cross_point(line a, line b) {
  double c1 = cross(diff_vector(b.st, a.st), diff_vector(b.en, a.st));
  double c2 = cross(diff_vector(b.st, a.en), diff_vector(b.en, a.en));
  double t = fabs(c1) / (fabs(c1) + fabs(c2));
  return sum_vector(prod_vector(diff_vector(a.en, a.st), t), a.st);
}
double distanceLP(line a, point b) {
  if (dot(diff_vector(a.en, a.st), diff_vector(b, a.st)) < 0.0) {
    return fabs(norm(diff_vector(b, a.st)));
  }
  if (dot(diff_vector(a.st, a.en), diff_vector(b, a.en)) < 0.0) {
    return fabs(norm(diff_vector(b, a.en)));
  }
  point h = projection(a, b);
  return norm(diff_vector(h, b));
}
double distanceLL(line a, line b) {
  double ans1, ans2, ans3, ans4;
  if (intersection(a, b)) {
    return 0.00000000000;
  } else {
    ans1 = distanceLP(a, b.st);
    ans2 = distanceLP(a, b.en);
    ans3 = distanceLP(b, a.st);
    ans4 = distanceLP(b, a.en);
  }
  return fmin(ans1, fmin(ans2, fmin(ans3, ans4)));
}
double area(int n, point ps[]) {
  int i;
  double ans = 0.0;
  for (i = 1; i <= n; i++) {
    ans += cross(ps[i - 1], ps[i % n]);
  }
  return ans / 2;
}
int isConvex(int n, point ps[]) {
  int i, tmp;
  line a;
  a.en = ps[0];
  a.st = ps[1];
  tmp = ccw(a, ps[2]);
  if (tmp != 1 && tmp != -1) {
    return 0;
  }
  for (i = 0; i < n; i++) {
    a.en = ps[i];
    a.st = ps[(i + 1 + n) % n];
    if (ccw(a, ps[(i + 2 + n) % n]) != tmp) {
      return 0;
    }
  }
  return 1;
}
int main(void) {
  point input[1000];
  double ans;
  int n, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf%lf", &input[i].x, &input[i].y);
  }
  printf("%d\n", isConvex(n, input));
  return 0;
}
