Go: package main

import (
        "fmt"
)

func main() {
        var x1, y1, x2, y2, x3, y3, px, py float64
        var oax, oay, obx, oby, opx, opy float64
        var det float64
        var s, t float64

        for {
                _, err := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py)
                if err != nil {
                        break
                }
                oax = x2 - x1
                oay = y2 - y1
                obx = x3 - x1
                oby = y3 - y1
                opx = px - x1
                opy = py - y1
                det = oax*oby - obx*oay

                if det == 0 {
                        fmt.Printf("NO\n")
                } else {
                        s = (oby*opx - obx*opy) / det
                        t = (oax*opy - oay*opx) / det

                        if (s+t < 1 && s > 0 && t > 0) {
                                fmt.Printf("YES\n")
                        } else {
                                fmt.Printf("NO\n")
                        }
                }
        }
}

C++: #include <cstdio>
#include <cmath>
#include <utility>

typedef std::pair<float, float> point;
typedef std::pair<float, float> vec;

inline float cross_product(const vec& v1, const vec& v2) {
    return v1.first * v2.second - v1.second * v2.first;
}

inline vec vec_sub(const vec& v1, const vec& v2) {
    return std::make_pair(v1.first - v2.first, v1.second - v2.second);
}

int main() {    
    point p1, p2, p3, p4;
    while (scanf("%f %f %f %f %f %f %f %f",
                 &p1.first, &p1.second,
                 &p2.first, &p2.second,
                 &p3.first, &p3.second,
                 &p4.first, &p4.second) != EOF) {
        vec v12 = vec_sub(p1, p2);
        vec v24 = vec_sub(p2, p4);
        float cp1 = cross_product(v12, v24);
        
        vec v23 = vec_sub(p2, p3);
        vec v34 = vec_sub(p3, p4);
        float cp2 = cross_product(v23, v34);
        
        vec v31 = vec_sub(p3, p1);
        vec v14 = vec_sub(p1, p4);
        float cp3 = cross_product(v31, v14);
        
        int r = std::signbit(cp1);
        r += std::signbit(cp2);
        r += std::signbit(cp3);
        
        printf(r == 0 || r == 3 ? "YES\n" : "NO\n");
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<n;i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

constexpr double EPS = 1e-9;

//???
class Point{
public:
    double x,y;
    Point (double x=0,double y=0) : x(x),y(y){}

    Point operator + (Point p){ return Point( x+p.x , y-p.y );}
    Point operator - (Point p){ return Point( x-p.x , y-p.y ); }
    Point operator * (double a){ return Point( a*x , a*y ); }
    Point operator / (double a){ return Point( x/a , y/a ); }

    double abs(){   //??§??????
        return sqrt(norm());
    }

    double norm(){  //?????????
        return x*x+y*y;
    }

    bool operator == (const Point &p) const{
        return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
    }
};

using Vector = Point;

double cross(Vector a,Vector b){ return a.x*b.y-a.y*b.x; }

void solve(Point p1,Point p2,Point p3,Point pin){

    //cout << p1.x << " " << p1.y << " " << p2.x << " " <<p2.y << " " <<p3.x << " " << p3.y << " " << pin.x << " " <<pin.y << endl;

    bool ok = true;
    Point p[3] = {p1,p2,p3};

    for(int i=0;i<3;i++){
        Vector v1 = Vector(p[(i+1)%3]-p[i]);
        Vector v2 = Vector(p[(i+2)%3]-p[i]);
        Vector vin = Vector(pin-p[i]);

        double c1 = cross(v1,vin);
        double c2 = cross(v1,v2);
        if(c1*c2 < -EPS) ok=false;
    }
    if(ok) cout << "YES" << endl;
    else cout << "NO" << endl;
}

int main(){
    while(true){
        double x1,x2,x3,xin,y1,y2,y3,yin;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xin >> yin;
        if(cin.eof()) break;
        solve(Point(x1,y1),Point(x2,y2),Point(x3,y3),Point(xin,yin));
    }
}

C++: /* {{{ Shinobu kawaii */
/*
  ______   __        _                  __                 
.' ____ \ [  |      (_)                [  |                
| (___ \_| | |--.   __   _ .--.   .--.  | |.--.   __   _   
 _.____`.  | .-. | [  | [ `.-. |/ .'`\ \| '/'`\ \[  | | |  
| \____) | | | | |  | |  | | | || \__. ||  \__/ | | \_/ |, 
 \______.'[___]|__][___][___||__]'.__.'[__;.__.'  '.__.'_/ 

*/
/* }}} */

#include <bits/stdc++.h>
using namespace std;

// #define int long long

/* cpp template {{{ */

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()

/* REPmacro */
#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

/* const */
const int INF = 999999999;
const double EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; std::cin >> x; return x;}
template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  REP(i, v.size()) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << '\n';
}
template <typename T>
void print(T x) {
  std::cout << x << '\n';
}

/* }}} */

typedef pair<double, double> P;

double cross(P& a, P& b) {
  return a.Fi * b.Se - a.Se * b.Fi;
}

P operator +(P& a, P& b) {
  return mp(a.Fi + b.Fi, a.Se + b.Se);
}
P operator -(P& a, P& b) {
  return mp(a.Fi - b.Fi, a.Se - b.Se);
}

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  P n[3];
  P p;

  while (cin >> n[0].Fi >> n[0].Se) {
    RREP(i, 2) cin >> n[i].Fi >> n[i].Se;
    cin >> p.Fi >> p.Se;
    bool flg = true;
    P v[] = {n[1] - n[0], n[2] - n[1], n[0] - n[2]};
    int check = 0;
    REP(i, 3) {
      P t = p - n[i];
      check += (cross(v[i], t) > 0) ? 1 : -1;
    }
    if (check == 3 || check == -3) print("YES");
    else print("NO");
  }

  return 0;
}