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>
#define int long long
#define endl '\n'
#define FOR(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
using namespace std;

using T = double;
const T EPS = 1e-10;
T torad(int deg) {return (T)(deg) * M_PI / 180;}
T todeg(T ang) {return ang * 180 / M_PI;}

/* Point */
using P = complex<T>;
#define x real()
#define y imag()
template <typename T> inline bool eq(T p, T q) { return abs(p - q) < EPS; }
inline int sgn(T x) { return (T(0) < x) - (x < T(0)); }
inline T dot(P v, P w) { return (conj(v) * w).x; }
inline T cross(P v, P w) { return (conj(v) * w).y; }
inline bool isOrth(P v, P w) { return dot(v, w) == 0; }
inline bool isPara(P v, P w) { return cross(v, w) == 0; }
inline P translate(P p, P v) { return p + v; }
inline P scale(P p, P c, T k) { return c + (p - c) * k; }
inline P rot(P p, T a) { return p * polar(1.0, a); }
inline P rot90(P p) { return {-p.y, p.x}; }
inline T orient(P a, P b, P c) { return cross(b - a, c - a); }
istream& operator>>(istream& is, P& p) { T xx, yy; is >> xx >> yy; p = P(xx, yy); return is; }
bool cmpX(const P& a, const P& b) { return a.x != b.x ? a.x < b.x : a.y < b.y; }
namespace std {
    bool operator < (const P& a, const P& b) { return cmpX(a, b); }
}

/* Polygon */
vector<P> makeStandard(vector<P> p) {
    int n = p.size(), j = -1;
    for (int i = 0; i < n; ++i) {
        if (j == -1 || p[i].y < p[j].y) j = i;
    }
    vector<P> res;
    if (p[(j - 1 + n) % n].x <= p[j].x && p[j].x <= p[(j + 1) % n].x) {
        for (int i = 0; i < n; ++i) {
            res.push_back(p[(i + j) % n]);
        }
    } else {
        for (int i = 0; i < n; ++i) {
            res.push_back(p[(i - j + n) % n]);
        }
    }
    return res;
}
bool isConvex(vector<P> p) {
    p = makeStandard(p);    // p[0] has minimum y and p is counterclockwise
    for (int i = 0, n = p.size(); i < n; ++i) {
        P a = p[i], b = p[(i + 1) % n], c = p[(i + 2) % n];
        if (orient(a, b, c) < 0) return false;
        if (b.y != p[0].y && b.y < min(a.y, c.y)) return false;
        if (b.y != p[0].y && a.y == b.y && b.y == c.y && a.x <= b.x && b.x <= c.x) return false;
    }
    return true;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    vector<P> ps(n);
    REP (i, n) cin >> ps[i];
    cout << isConvex(ps) << endl;
}
