import java.util.Scanner;

public class Main {
  private static final int IROHA = 17;
  public static void main(String[] args) {
    try (Scanner scan = new Scanner(System.in)) {
      String input = scan.nextLine();
      String[] arr = input.split("\\s");
      String result = "YES";
      try {
        int sum = 0;
        for (String s: arr) {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        }
        if (sum != IROHA) {
          result = "NO";
        }
      } catch (NumberFormatException e) {
        result = "NO";
        throw e;
      }
      System.out.println(result);
        
    }
  }
} import java.util.Scanner; Scanner java.util public class Main {
  private static final int IROHA = 17;
  public static void main(String[] args) {
    try (Scanner scan = new Scanner(System.in)) {
      String input = scan.nextLine();
      String[] arr = input.split("\\s");
      String result = "YES";
      try {
        int sum = 0;
        for (String s: arr) {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        }
        if (sum != IROHA) {
          result = "NO";
        }
      } catch (NumberFormatException e) {
        result = "NO";
        throw e;
      }
      System.out.println(result);
        
    }
  }
} Main private static final int IROHA = 17; IROHA 17 public static void main(String[] args) {
    try (Scanner scan = new Scanner(System.in)) {
      String input = scan.nextLine();
      String[] arr = input.split("\\s");
      String result = "YES";
      try {
        int sum = 0;
        for (String s: arr) {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        }
        if (sum != IROHA) {
          result = "NO";
        }
      } catch (NumberFormatException e) {
        result = "NO";
        throw e;
      }
      System.out.println(result);
        
    }
  } main {
    try (Scanner scan = new Scanner(System.in)) {
      String input = scan.nextLine();
      String[] arr = input.split("\\s");
      String result = "YES";
      try {
        int sum = 0;
        for (String s: arr) {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        }
        if (sum != IROHA) {
          result = "NO";
        }
      } catch (NumberFormatException e) {
        result = "NO";
        throw e;
      }
      System.out.println(result);
        
    }
  } try (Scanner scan = new Scanner(System.in)) {
      String input = scan.nextLine();
      String[] arr = input.split("\\s");
      String result = "YES";
      try {
        int sum = 0;
        for (String s: arr) {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        }
        if (sum != IROHA) {
          result = "NO";
        }
      } catch (NumberFormatException e) {
        result = "NO";
        throw e;
      }
      System.out.println(result);
        
    } {
      String input = scan.nextLine();
      String[] arr = input.split("\\s");
      String result = "YES";
      try {
        int sum = 0;
        for (String s: arr) {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        }
        if (sum != IROHA) {
          result = "NO";
        }
      } catch (NumberFormatException e) {
        result = "NO";
        throw e;
      }
      System.out.println(result);
        
    } Scanner scan = new Scanner(System.in) Scanner scan = new Scanner(System.in) new Scanner(System.in) String input = scan.nextLine(); input scan.nextLine() scan.nextLine scan String[] arr = input.split("\\s"); arr input.split("\\s") input.split input "\\s" String result = "YES"; result "YES" try {
        int sum = 0;
        for (String s: arr) {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        }
        if (sum != IROHA) {
          result = "NO";
        }
      } catch (NumberFormatException e) {
        result = "NO";
        throw e;
      } catch (NumberFormatException e) {
        result = "NO";
        throw e;
      } NumberFormatException e {
        result = "NO";
        throw e;
      } result = "NO" result "NO" throw e; e {
        int sum = 0;
        for (String s: arr) {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        }
        if (sum != IROHA) {
          result = "NO";
        }
      } int sum = 0; sum 0 for (String s: arr) {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        } String s arr {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        } {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        } if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          } s.matches("^[57]$") s.matches s "^[57]$" {
            sum += Integer.parseInt(s);
          } sum += Integer.parseInt(s) sum Integer.parseInt(s) Integer.parseInt Integer s {
            result = "NO";
          } result = "NO" result "NO" if (sum != IROHA) {
          result = "NO";
        } sum != IROHA sum IROHA {
          result = "NO";
        } result = "NO" result "NO" System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
  private static final int IROHA = 17;
  public static void main(String[] args) {
    try (Scanner scan = new Scanner(System.in)) {
      String input = scan.nextLine();
      String[] arr = input.split("\\s");
      String result = "YES";
      try {
        int sum = 0;
        for (String s: arr) {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        }
        if (sum != IROHA) {
          result = "NO";
        }
      } catch (NumberFormatException e) {
        result = "NO";
        throw e;
      }
      System.out.println(result);
        
    }
  }
} public class Main {
  private static final int IROHA = 17;
  public static void main(String[] args) {
    try (Scanner scan = new Scanner(System.in)) {
      String input = scan.nextLine();
      String[] arr = input.split("\\s");
      String result = "YES";
      try {
        int sum = 0;
        for (String s: arr) {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        }
        if (sum != IROHA) {
          result = "NO";
        }
      } catch (NumberFormatException e) {
        result = "NO";
        throw e;
      }
      System.out.println(result);
        
    }
  }
} Main
import java.util.Scanner;

public class Main {
  private static final int IROHA = 17;
  public static void main(String[] args) {
    try (Scanner scan = new Scanner(System.in)) {
      String input = scan.nextLine();
      String[] arr = input.split("\\s");
      String result = "YES";
      try {
        int sum = 0;
        for (String s: arr) {
          if (s.matches("^[57]$")) {
            sum += Integer.parseInt(s);
          } else {
            result = "NO";
          }
        }
        if (sum != IROHA) {
          result = "NO";
        }
      } catch (NumberFormatException e) {
        result = "NO";
        throw e;
      }
      System.out.println(result);
        
    }
  }
}