#include <bits/stdc++.h>
using namespace std;
int dp[300050][20];
int a[300050][20];
int last[25];
int main() {
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    int num;
    scanf("%d", &num);
    for (int j = 0; j < 20; j++) {
      a[i][j] = num % 2;
      num /= 2;
    }
  }
  memset(last, -1, sizeof(last));
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 20; j++) {
      dp[i][j] = n;
    }
    for (int j = 0; j < 20; j++) {
      if (a[i][j] && last[j] != -1) {
        for (int k = 0; k < 20; k++) {
          dp[i][k] = min(dp[i][k], dp[last[j]][k]);
        }
      }
      if (a[i][j]) {
        last[j] = i;
        dp[i][j] = i;
      }
    }
  }
  while (q--) {
    int x, y;
    scanf("%d%d", &x, &y);
    int f = 0;
    for (int i = 0; i < 20; i++) {
      if (a[y - 1][i] && dp[x - 1][i] <= y - 1) {
        printf("Shi\n");
        f = 1;
        break;
      }
    }
    if (!f) printf("Fou\n");
  }
  return 0;
}
