	SUBROUTINE YESNO(FLAG,VALID)

	LOGICAL*1 FLAG,VALID
	BYTE YES(3),NO(3),ANSWER(3)
	DATA YES/'Y','E','S'/
	DATA NO/'N','O',' '/

	VALID=.TRUE.
	FLAG=.FALSE.
	READ(1,10002,END=800,ERR=10020)NCHRS,(ANSWER(I),I=1,3)
10002	FORMAT(Q,3A1)
	IF(NCHRS.EQ.0)GOTO 10001
	IF(NCHRS.GT.3)NCHRS=3
C
C	Make lower case characters upper case
C
	DO 10004 I=1,NCHRS
	IF((ANSWER(I).LE.'a').OR.(ANSWER(I).GE.'z'))GOTO 10004
	ANSWER(I)=ANSWER(I)-"40
10004	CONTINUE
C
C	Check for yes
C
	DO 10005 I=1,NCHRS
	IF(ANSWER(I).NE.YES(I))GOTO 10011
10005	CONTINUE
	FLAG=.TRUE.
	GOTO 10001
C
C	Check for a no
C
10011	DO 10007 I=1,NCHRS
	IF(ANSWER(I).NE.NO(I))GOTO 10020
10007	CONTINUE
	GOTO 10001
C
C	Incorrect response
C
10020	VALID=.FALSE.
10001	RETURN
800	CONTINUE
	CALL EXIT
	END
